I’m a total newbie with the jsf and ICEfaces frameworks, and we started to playing around with them a couple of weeks ago.
Now we are trying to perfom a push without using AJAX, in order to make this operation avaiable trough a WebService.
I found this thread, which seems to be something like we want to do, but I’m still a bit lost. The guy claims to have succeded:
I wired my Renderable class into my
web service so it simply has to call
the appropriate method to request the
render.
Could anybody give me a hint on how to “wire” the WebService to the Renderable class?
I suspect there is something to do with the PortableRendered, but as I told you, I’m still a bit lost.
Regards.
The following example is the simplest case. A sports score is updated in the web browser every two seconds using an ICEfaces push update.
The method ScoreManagerBean.postConstruct() is called after the managed bean is constructed for a new session. This method starts a thread that calls PortableRenderer.render(sessionId) every two seconds, causing the new score to be pushed to the web browser. In a real application, the push update would be run in some kind of callback function after receiving a message/trigger that data in the application has changed.
Exactly the same concept is used for more complex applications such as news-tickers and ebay-style auction sites.
Here is the managed bean class ScoreManagerBean.java:
and the web page pushexample.xhtml that displays the current score: