开发者

Is there a better Ajax Push for JSF 2.0 than Icefaces

开发者 https://www.devze.com 2023-01-12 04:16 出处:网络
I am in a situation where I would like to implement Ajax Push in a Java based web app to update things like counts of item in stock on the web page as they change without any interaction from the user

I am in a situation where I would like to implement Ajax Push in a Java based web app to update things like counts of item in stock on the web page as they change without any interaction from the user. I understand that the technology needed to do this is called Ajax Push. I a开发者_开发知识库lso have some experience with JSF 2.0, and this is preferred but not required.

First we need a demo showing this in about a couple of weeks, but if the demo is accepted we will have sufficient time to do it right.

I've looked around and found that apparently Icefaces do this very well, and I will look into it. I would just like to hear if there happens to exist others which might even be better for us to use?

Please, no "these are the top three hits from Google" answers. I'd like to hear opinions based on experiences.


You can now use Ajax Push outside of ICEfaces. Checkout http://www.icepush.org/. There are client adapters for JSP, Spring MVC, Wicket, GWT, jQuery, prototype, and Grails.


We have tried both Icefaces (in JSF 1.2 mode) and Atmosphere/Comet with Primefaces.

Icefaces push worked brilliantly out of the box.

We couldn't get Atmosphere to work (in Primefaces), but this could be because we tried it with the latest (0.6) version, and Primefaces doesn't support it yet - so now we are waiting for an updated version (it is promised that it will be the next big feature after p:dataTable has been rewritten). In our case the push was not a critical element in the demo and we could easily use polling instead of a real push solution.

Icepush was very easy to get up and running, while Atmosphere is not very well documented (IMHO), and requires a bunch of jars and configurations. It is not for beginners for sure.

So, if ajax:push is a key part of your demo I'd suggest that you stay with JSF 1.2 and Icefaces. At least until the demo is done and the customer is happy - you can still take you time with the Atmosphere configuration after that ;-)


I don't know if it is better since I don't do IceFaces, but PrimeFaces has a <p:push> component as well. It makes use of Atmosphere under the hoods to be as much as possible appserver-independent, which is in turn already pretty awesome. It abstracts all the appserver-specific details away. Also see this article about Servlet 3.0 vs. Atmosphere:

Atmosphere always auto-detected the best asynchronous API when you deploy your application. It always try first to look up the 3.0 Async API. If it fails, it will try to find WebServer's native API like Grizzly Comet (GlassFish), CometProcessor (Tomcat), Continuation (Jetty), HttpEventServlet (JBossWeb), AsyncServlet (WebLogic), Google App Engine (Google). Finally, it will fallback to use a blocking I/O Thread to emulate support for asynchronous events.

How to get it all to work is in detail explained in chapter 6 of PrimeFaces User Guide (PDF) in flavor of a chat application as it is presented in the <p:push> showcase page.


I think ICEfaces is the best solution for AJAX PUSH, they pioneered it, and in my opinion they have the best implementation.


Primefaces looks promising but the push functionality doesnt work with their latest release. With Icefaces 2 beta, push works OOTB.


There is an independent atmosphere framework based push implementation for jsf 2.2 named Ext JSF Push. It is fully integrated into JSF and can push to a single client, push render directly to a group of clients or push rendering events to a group of clients:

<e:push id="some-channel" direct="true">
    <h:outputText id="text" value="#{pushTest.value}"/>
</e:push>

A rendering event inside the push tag can be triggered either by traditional render attribute or by code call. Rendering is transparently broadcast to all connected clients (http://www.intersult.com/wiki/page/JSF%20Ext%20Push).


ICEfaces is definitely your best best for the short-term demo requirements, as well as your longer-term "doing it right" goals.

To begin with, ICEfaces provides the most natural model for developing push applications. You think in simple terms of server-side triggers causing state changes in your application. ICEfaces and JSF do the rest, affecting seamless rendering of the new state. No messy push tag markup where you have to declare precisely how the presentation changes with each push event. If you know JSF, adding push to an application is dead simple with ICEfaces. Get your basic JSF application working first, and then add the necessary push logic to your server-side code. No other changes required.

Longer-term you should know that ICEfaces provides all the deployment technology you will need for enterprise-strength deployments. Enterprise Push Server is central to this as it provides complete push connection management in clustered environments (see: EPS). ICEfaces Ajax Push is operating in a wide spectrum of production environments in many Fortune 500 enterprises, so you can rest assured it will scale to your demands. Additionally, professional customer support is available. These are all be key characteristics that will help you sell the substance behind your demo.

Nothing else in the marketplace compares, and look forward to ICEfaces 2.0 which is JSF 2.0 compliant, and brings next-generation Ajax Push capabilities. Its available in Beta now.

0

精彩评论

暂无评论...
验证码 换一张
取 消