Question

In my web application there's a page where users can post messages. The problem is a user always has to click a button 'get messages' to see the messages other users have posted since the moment the user started viewing the page. So the information the user is viewing is only up to date from the moment he clicked the button 'get messages' again. How can I accomplish in JSF 2.0 that when an other user deletes, inserts or updates a message, the other users can see these changes directly. One could say I'd like to accomplish something like the Facebook application does: if someone posts new information, his 'friends' can see it directly in their feed without having to push a button. Any help would be greatly appreciated.

I'm using JSF 2.0 and GlassFish Server.

Était-ce utile?

La solution

You can either do polling or pushing.

Pushing is better. Refer to this thread on how to do it with JSF How can server push asynchronous changes to a HTML page created by JSF?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top