在我的web.xml我用的是這樣的:被阻擋除了那些以/開始面臨/安全約束和歡迎文件
<security-constraint>
<web-resource-collection>
<web-resource-name>Block all</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Allow facelets</web-resource-name>
<url-pattern>/faces/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
所有傳入的請求。 我這樣做是因爲,否則,未經授權的用戶可以訪問facelets源文件。
它工作正常,但它不顯示歡迎文件,因爲即使根路徑被阻止。 我試圖添加<url-pattern>/</url-pattern>
到第二個安全約束,但沒有。
我是唯一一個有這種問題的人!有沒有其他方法來保護facelets源文件? – Alf 2011-03-01 18:24:59