This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having problem when using web.xml to provide login system to user.

Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to build a login system into my webapps.
Below is my web.xml and my tomcat-users.xml. I try to login using "myRole" and "myPassword" but it doesn't work. It keeps showing me the pop-up box until it fails to login and gives me HTTP error 401.
I'm using Tomcat 4.1.29.

Could somebody please advice?


<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns=""

<description>Link to the UserDatabase instance from which
we request lists of defined role names.</description>

<description>pages which require login</description>

<description>Must authenticate before querying the system</description>


<realm-name>TEST PAGE</realm-name>


<?xml version='1.0' encoding='utf-8'?>
<role rolename="myRole"/>
<user username="myRole" password="myPassword" roles="myRole"/>
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic