我有一些XHTML頁面。當我運行項目時,即使我沒有登錄,我也可以查看該頁面。當我直接在地址欄中鍵入內容時,我可以訪問該頁面。如何在用戶未登錄時確保網頁的安全
如何保護我的XHTML文件(login.xhtml
除外)?我試圖給FacesConfig添加一個安全約束,但它會阻止我的所有*.xhtml
,即使是login.xhtml
。
更新
我說這對我的web.xml文件
<security-constraint>
<display-name>Protection</display-name>
<web-resource-collection>
<web-resource-name>Protection</web-resource-name>
<description>Protection</description>
<url-pattern>/secured/*</url-pattern>
</web-resource-collection>
</security-constraint>
我把我所有的文件預計login.xhtml
在/secure
文件夾中。
但是當我運行該項目時,我可以隨時訪問,當我在地址欄中鍵入.../secured/*.jsf
。如何保護它,當我離線瀏覽或者沒有登錄。
對不起!我的意思是web.xml。 – Steffi 2010-12-07 20:54:10