如何使用PrimeFaces websocks与Glassfish 3.1和JSF2进行服务器推送 [英] How to use PrimeFaces websocks for server push with Glassfish 3.1 and JSF2
问题描述
6.1安装
推送服务器
PrimeFaces Push使用一个servlet作为调度器。这个servlet应该与JSF应用程序在不同的应用程序中,并且目前只能在jetty服务器上部署。
所以Jetty - 只支持应该是一个非问题。您可以继续在Glassfish中运行JSF2 Web应用程序。如果您只有一台服务器,您只需在另一个端口上并排设置并运行Jetty。
原因很可能是因为websocket不受支持标准的Servlet API规范(但是即将推出的Servlet 3.1计划)。使用Servlet 3.0和更旧版本,您需要容器特定的代码和库。 PrimeFaces可能不值得花
的努力来为各种现有的servlet容器和PrimeFaces JAR提供容器特定的代码和库。
The PrimeFaces pdf says that websockets with server push is only available with Jetty but Glassfish3.1 does have a websockets component with grizzly. Is the documentation wrong? has anyone used these two for push with websockets? How was this done?
The PrimeFaces Users Guide documentation is right. Note that it's literally telling that the push servlet has to run in a different application than the JSF2 application itself.
6.1 Setup
Push Server
PrimeFaces Push uses a servlet as a dispatcher. This servlet should be in a different application than the JSF application and at the moment can only be deployed on jetty server.
So the Jetty-only support should be a non-issue. You can just keep running your JSF2 webapp in Glassfish. You just have to setup and run Jetty side by side on a different port if you have only one server machine.
The reason is most likely because the websockets are not supported by standard Servlet API spec (it's however planned for the upcoming Servlet 3.1). With Servlet 3.0 and older, you would need container specific code and libraries. It's for PrimeFaces likely not worth the effort to ship the container specific code and libraries for a wide range of existing servletcontainers along with the PrimeFaces JAR.
这篇关于如何使用PrimeFaces websocks与Glassfish 3.1和JSF2进行服务器推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!