Add User under Tomcat 6.0 \ conf \ tomcat-users.xml directory
<Tomcat-users>
<Role rolename = "manager"/>
<Role rolename = "admin"/>
<Role rolename = "lluser"> (after the server is started, the automatically added server is started)
<User Username = "admin" Password = "LCP" roles = "Admin, Manager"/>
<User Username = "Lop" Password = "Lop" roles = "admin"/>
User Username = "ll" Password = "LCP" roles = "lluser">
</Tomcat-users>
You need to configure the web-INF/Web. xml file to complete logon verification.
<welcome-file-list> <welcome-file>main.html</welcome-file> </welcome-file-list> <security-constraint> <web-resource-collection>RegisteredUsers</web-resource-collection> <url-pattern>/count.jsp</url-pattern> <auth-constraint> <role-name>lluser</role-name> <role-name>admin</role-name> </auth-constraint> </security-constraint> <login-config> <auto-method>BASIC</auto-method> <realm-name>Registered Users</realm-name> </login-config> <security-role> <role-name>lluser</role-name> </security-role> <security-role> <role-name>admin</role-name> </security-role>
Add a tomcat user-role Verification