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