I have a small application for which I need to implement tomcat authentication. After digging the internet, I found out Realm is the solution. Also I got how to configure my tomcat-users.xml, server.xml and web.xml. but it is still not working.
I added this code in my web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>hp</web-resource-name>
<url-pattern>/pages/bill.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>>
<realm-name>default</realm-name>>
</login-config>
at login-config, I am getting Element 'login-config' cannot have character [children], because the type's content type is element-only. What can be the issue ?