There are two ways to meet your needs:
First polling, in which you resubmit requests from the client to the server. On the server side, for some reason, you need a message queue for each client to deliver incidents on demand. There is also another type of polling in which you send a request from the client and never end the request on the server side, so you have some kind of pipe between the two ends. This is called long polling. The disadvantage of polling is that you have to send requests to the server forever from the client, and in many cases the server sends empty messages because there were no events.
pushing websockets ( html5). websocket. afaik jetty tomcat . Spring 4 websocket, ; http://syntx.io/using-websockets-in-java-using-spring-4/
postoverflow post