服务器到客户端的推送通知?

服务器到客户端的推送通知?

问题描述:

我需要为我的应用程序的特定功能的解决方案,特点是同栈的新成就类别overflow.When特定事件发生的服务器(可能是某种程度的成就或某种条件满足),那么我想通过我的应用程序的GUI通知用户,什么是做这个特异性使用情况下,最好的办法.thanks在adnvance

I need a solution for a specific feature of my application ,feature is same as recent achievements category of stack overflow.When a specific event happen in server (may be some level achievement or some kind of condition satisfy)then i want to notify to user through the GUI of my application ,What is the best approach to do this specif use case .thanks in adnvance

您会要么需要使用的WebSockets 或客户方投票。

You'll either want to use WebSockets or clientside polling.

有几个Java库都来帮你提取从底层机制,可以回退到轮询的WebSockets,如果没有浏览器支持:

There's a few java libraries out there to help abstract you from the underlying mechanics which can fallback to polling if websockets are not supported by the browser:


  1. 的cometd

  2. 气氛

  3. DWR的反向AJAX

  4. Spring MVC的

  1. cometd
  2. atmosphere
  3. DWR's reverse-ajax
  4. spring mvc

我肯定还有更多但会得到您开始:)

Im sure there's more but that'll get you started :)