我有一些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