<security-constraint>
<web-resource-collection>
<web-resource-name>force login</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>/*</url-pattern>
<!-- If you list http methods, only those methods are protected -->
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>yy_role</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>force login</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>yy_role</role-name>
</security-role>