将 HTML5 Websocket 与 Spring 结合使用
我想将 Websockets 与 Spring MVC 支持的 Web 应用程序一起使用。我读过 jWebsockets 和 bristleback,但我想知道这是否是最好的集成方式。我确信以前有人这样做过,并且有一些建议,什么有效,什么无效......
谢谢!
I'd like to use Websockets with a Spring MVC-powered web app. I've read o jWebsockets and bristleback, but I am wondering if that is the best way to integrate. I am sure someone has done this before and has some tips what works and what does not...
Thanx!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
由于支持 Springframework 4.0 M1 Websocket,请参阅 http:// blog.springsource.org/2013/05/22/spring-framework-4-0-m1-websocket-support/
编辑 - 2014年1月8日:Springframework 4.0发布并支持websocket,玩得开心。
since Springframework 4.0 M1 Websocket are supported, see http://blog.springsource.org/2013/05/22/spring-framework-4-0-m1-websocket-support/
Edit - 08 january 2014: Springframework 4.0 released and supports websocket, have fun.
这是 4.0 M2 的更新,请参阅 http://blog.springsource.org/2013/07/24/spring-framework-4-0-m2-websocket-messaging-architectures/
Here is an update on 4.0 M2, see http://blog.springsource.org/2013/07/24/spring-framework-4-0-m2-websocket-messaging-architectures/
Spring MVC 不会为您提供任何帮助 - 它仅支持使用 Servlet 和 Portlet API 的 HTTP 流量。我认为 Websocket 不是基于 HTTP 的。
Spring MVC will offer you no help here - it supports HTTP traffic using the Servlet and Portlet APIs only. Websockets, I believe, are not HTTP-based.
Spring 计划实现许多流行应用服务器提供的 WebSocket servlet。主要问题是,由于每个服务器都有自己的 websocket 实现,因此它们差异很大。 Atmosphere Framework 可用,并且支持跨服务器、跨浏览器实现。
有一些博客文章可用,例如 结合大气 websockets 和 comet使用 Spring MVC
我建议您在决定它是否适合您之前先研究该框架。他们还提供 带有演示和文档的 github src 存储库。
Spring has plans to implement the WebSocket servlets offered by many popular application servers. The main problem is that, as each server comes out with it's own webscocket implementation, they all vary greatly. The Atmosphere Framework is available, and supports cross server, cross browser implementations.
There are some blog posts available, like combining atmosphere websockets and comet with Spring MVC
I would suggest you research the framework before deciding it's right for you. They have a github src repo with demo's and documentation available as well.
似乎已计划支持,https://jira.springsource.org/browse/SPR-9356< /a> (但他们需要解决缺乏 Servlet API 支持的问题)
It seems that support is planned, https://jira.springsource.org/browse/SPR-9356 (but they'll need to work around the lack of Servlet API support)