1
在我的项目中,我使用SSL,但它适用于所有页面。我只想将它用于登录页面,在该页面之后它应该恢复为HTTP协议。我怎样才能做到这一点?我发现了一种方法,但它不起作用。如何强制只使用SSL打开一个页面?
<security-constraint>
<web-resource-collection>
<web-resource-name>Notify page, accessed internally by application</web-resource-name>
<url-pattern>/Login.xhtml</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Site</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
我的项目是一个JSF 2.0的项目,我使用Eclipse赫利俄斯和Tomcat 7.0。
谢谢。
感谢您的有用答案。我想在登录后切换HTTP和HTTPS,因为我使用Primefaces及其某些组件(例如文件上载器)在HTTPS时发生错误。我不知道为什么,但它正在发生,为此我只想将SSL设置为登录页面。如果你可以帮助Primefaces的错误,当然这会很好。 – amrXX 2011-05-11 16:16:06
问一个新问题或者向PrimeFaces报告此问题。 – BalusC 2011-05-11 16:27:52