2014-01-31 38 views
0

我正在寫一個使用JSF和PrimeFaces的CRUD Web應用程序,我希望能夠與安全的SSL連接一起使用。我正在使用GlassFish 4.0和PrimeFaces 4.0。我正在使用自簽名SSL證書並在GlassFish服務器上使用256位AES加密。PrimeFaces不能與https一起工作

我的問題是,當我從http:// localhost:8080/切換到https:// localhost:8181/...任何調用輔助bean的PrimeFaces組件停止工作。例如,通常當我點擊一個數據錶行時,會打開一個對話框。使用https,它似乎掛起並且對話框不顯示。同樣,在提交新記錄時,輔助bean不會被調用。我認爲解決方案很簡單,我沒有正確配置。一切工作正常與普通的http。什麼可能導致這個?

以下附上我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" version="2.5"> 

<display-name>JavaServerFaces</display-name> 

<!-- Change to "Production" when you are ready to deploy --> 
<context-param> 
    <param-name>javax.faces.PROJECT_STAGE</param-name> 
    <param-value>Development</param-value> 
</context-param> 

<context-param> 
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name> 
    <param-value>true</param-value> 
</context-param> 

<context-param> 
    <param-name>primefaces.SUBMIT</param-name> 
    <param-value>partial</param-value> 
</context-param> 

<!-- Welcome page --> 
<welcome-file-list> 
    <welcome-file>faces/test.xhtml</welcome-file> 
</welcome-file-list> 

<!-- JSF mapping --> 
<servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

<!-- Map these files with JSF --> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>/faces/*</url-pattern> 
</servlet-mapping> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.jsf</url-pattern> 
</servlet-mapping> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.faces</url-pattern> 
</servlet-mapping> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.xhtml</url-pattern> 
</servlet-mapping> 

</web-app> 

回答

0

我發現了答案我自己的問題。我使用的是Firefox,它阻止了網站的未加密部分,顯然這些部分包含那些以上不工作的部分。解除此保護即可返回完整功能。

我不確定這是否意味着來自數據庫的數據是未加密的,所以我將單獨研究並在必要時發佈另一個問題。

相關問題