在 dropwizard 中反转 ajax

Reverse ajax in dropwizard

我想在 Dropwizard 中实现反向 ajax application.How 我可以这样做吗? Dropwizard 是否提供任何工具来完成此操作?

如有任何意见,我们将不胜感激。 提前致谢

有几种反向 AJAX(轮询、websockets、piggy backing、comet)。 Atmosphere,异步 comet/websockets 框架与 Jersey 配合得很好。您可以在这里尝试一下:https://github.com/Atmosphere/atmosphere

这里似乎还有一个捆绑的 Dropwizard/Atmosphere 版本: https://github.com/mgutz/dropwizard-atmosphere/

据我所知,反向 ajax 在 Dropwizard.But 中不直接可用,反向 ajax 的效果可以直接使用网络套接字或长轮询来建立。 Web 套接字是客户端和服务器之间异步通信的有效方式,无需在客户端重新加载任何页面。

在 dropwizard 中建立 web-socket 的方式有很多种,我最喜欢的是 jetty websocket。

a simple websocket working example is available here