将通知推送到客户端 [英] Push Notification to Client

查看:112
本文介绍了将通知推送到客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Struts,Spring和Hibernate构建了我的项目。我正在使用Tomcat作为服务器。现在,我想在我的Web应用程序中实现推送通知,以执行诸如根据数据库中的新数据更新视图层上的表的任务,或者在发生特定条件时显示通知。我该如何实现这个,我应该使用哪些工具?也许彗星或类似的东西?如果你有教程的链接,我会发现它很有用。



我也想知道这个(推送)是否与消息传递有关?



我试过此链接
但看起来像拉。我的情况就像一个聊天应用程序 - 如果有人登录,其他成员将收到通知。我对如何实现这个感到困惑。

解决方案

您是否尝试过框架气氛?它支持websocket,也可以回退到提到的longpolling。



它可以在客户端与jquery一起使用。教程是这里。 / p>

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.

这篇关于将通知推送到客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆