Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I currently have a web application and I would like to add a messaging feature to it. In order to do that, I use JMS(actually OpenMQ, the implementation provided with Glassfish 3). The problem is that I do not know how to get the message notification from the background(from the listener) to the foreground. I am using JSF as a framework, if it does have an importance. Could you please tell me how should I notify the user about a received message(like a chat). Any suggestions are welcomed(tutorials, advices or libraries, but all these should be free).

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You may be interested in Comet, a programming model that allows the server to push data to a client. There are implementations for JSF, look at this blog post about Richfaces integration for an example.

HTML 5 specifies WebSockets that can be used for server push, but not all browsers support it.

The simple alternative is to simply poll the server at regular intervals, that might create a lot of unnecessary messages though.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.