<security-constraint>
<web-resource-collection>
<web-resource-name>Common pages</web-resource-name>
<url-pattern>/test1.html</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>MY_GROUP</role-name>
</auth-constraint>
</security-constraint>
予想どおり、この制約により、ページ /test1.html は認証が必要であり、ページ /test2.html は認証を必要としません。
<security-constraint>
<web-resource-collection>
<web-resource-name>Common pages</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>MY_GROUP</role-name>
</auth-constraint>
</security-constraint>
予想どおり、この制約により、/test2.html を含むすべてのページで認証が必要になります。
<security-constraint>
<web-resource-collection>
<web-resource-name>Common pages</web-resource-name>
<url-pattern>/</url-pattern>
<url-pattern>/test1.html</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>MY_GROUP</role-name>
</auth-constraint>
</security-constraint>
この制約により、ページ /test1.html および / は認証が必要であると予想されますが、ページ /test2.html は認証を必要としません。
ただし、 /test2.html にも認証が必要であることが判明しました。
質問 1. それは正常ですか? どうしてですか?
質問 2. url-pattern "/" が "/*" に相当することは、仕様のどこに記述されていますか? Java サーブレット仕様 2.5: http://goo.gl/UxoPL
質問 3. ルート ページ "/" では認証が必要であるが、他のページでは必要ないことをどのように判断できますか?
ps: jboss-eap-4.3 を使用しています。