I built my project using Struts, Spring, and Hibernate. I am using Tomcat for the server. Now I want to implement push notifications in my web application, to perform tasks like updating a table on a view layer according to new data in the database, or show a notification when a certain condition occurs. How can I implement this, and what tools should I use? Maybe Comet or something similar? If you have a link to a tutorial, I would find that helpful.
I am also wondering whether this (push) is related to messaging?
I've tried this link but it looks like pull. My case is like a chatting application - if someone logs in, the other member will get a notification. I am confused about how to implement this.
Have you tried the framework Atmosphere ? It supports websocket and also fallback to mentioned longpolling.
It can be used with jquery on the client side. Tutorial is here .
Well the easiest way is use ajax calls with long polling(jQuery comes to mind). Comet is fine too.
使用Spring STOMP WebSockets ..它非常简单易用https://spring.io/guides/gs/messaging-stomp-websocket/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.