【发布时间】:2014-01-31 12:00:17
【问题描述】:
我正在使用 JSF 和 PrimeFaces 编写一个 CRUD Web 应用程序,我希望它能够与安全 SSL 连接一起使用。我正在使用 GlassFish 4.0 和 PrimeFaces 4.0。我在 GlassFish 服务器上使用自签名 SSL 证书并使用 256 位 AES 加密。
我的问题是,当我从 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>
【问题讨论】:
标签: jsf primefaces https