IntelliJ Java IDE
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes how can i set password in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "how can i set password in web.xml" Watch "how can i set password in web.xml" New topic
Author

how can i set password in web.xml

Niu Xiuyuan
Ranch Hand

Joined: Jun 08, 2001
Posts: 68
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</auth-constraint>
this is one part in web.xml dd file, i just can define roles but can't define the password corresponding with roles.how can help?


Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi Niu,
there is a file called tomcat-users.xml in the conf under tomcat-root.
There you can insert users and map those users to roles.
(There are allready example users in the file)
This is for separating programmer and deployer role. The programmer can use reusable roles in his app and its the responsability of the deployer or the administrator to map those roles to actual users.
In commercial app-servers you are not constrained to such a simple file-based user-administration. You can use ldap or rdbms. But the mechanism stays the same. The roles are mapped to actual users at deployment time.
Axel
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
found that ressource about tomcat and security:
http://www.onjava.com/pub/a/onjava/2001/07/24/tomcat.html
Havent tested, but looks very good. JDBC realms are not part of the exam as far as I know. But there seems to be a good example about using tomcat-users.xml
Axel
 
 
subject: how can i set password in web.xml
 
Threads others viewed
BASIC Authentication in WAS 3.5.x
Using ROLES defined in a database in th DD
security issue
Which one is first? Authentication/Authorisation
Servlet User Roles
IntelliJ Java IDE