使用 Spring MVC 的 RESTEasy 异步 HTTP
有没有任何方便的方法可以将 RESTEasy 异步 HTTP 支持(在我的例子中是 Tomcat 6)与 Spring MVC 框架结合使用。我发现了有关在 Spring 中使用 RESTEasy 的有用文章,但没有一篇涵盖异步支持,目前这似乎有点棘手,因为根据容器需要不同的 Servlet 类(例如,用于 Tomcat 的 Tomcat6CometDispatcherServlet) 。
谢谢, FB
Is there any handy way to use RESTEasy Asynchronous HTTP support (in my case on Tomcat 6) in conjunction with the Spring MVC framework. I've found useful articles on using RESTEasy with Spring, but none that cover asynchronous support, which appears to be a bit of a thorn at present, due to requring a different Servlet class depending on the container (Tomcat6CometDispatcherServlet for Tomcat, for example).
Thanks,
FB
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 Comet、Bayeux、Java、Maven 和 Raphael JS 前端创建了一个示例应用程序,并撰写了一篇关于它的博客文章,您可以将它用作您的应用程序的基础,只需将当前的服务代码包装在 REST 中即可。
http://geeks.aretotally.in/thinking-in -reverse-not-takeing-orders-from-yo
希望它会对您有所帮助。
I have created a sample app using Comet, Bayeux, Java, Maven and a Raphael JS frontend and wrote a blog post about it, you can use it as a base for your app, just wrapping the current service code in REST.
http://geeks.aretotally.in/thinking-in-reverse-not-taking-orders-from-yo
Hopefully it will help you.
对于任何感兴趣的人,我最终不得不使用 Tomcat6CometDispatcherServlet 而不是 Spring DispatcherServlet 来让我的应用程序正常工作。
我仍然有 Spring ContextLoaderListener 来在我的应用程序上下文中创建各种 bean,但必须使用不太理想的方式从我的控制器类中访问这些 bean,这些类现在是 JAX-RS 注释而不是 Spring MVC 注释。 (Google 很快就会发现有关以编程方式访问 Spring 上下文的各种文章。)
这是我的 web.xml 的清理版本(没什么惊天动地的,但也许它会给某人一些有用的提示!):
For anybody interested, I ended up having to use the Tomcat6CometDispatcherServlet in preference to the Spring DispatcherServlet to get my application working.
I still have the Spring ContextLoaderListener in place to create the various beans within my Application Context, but have to use less than ideal means of accessing these from within my Controller classes, which are now JAX-RS annotated rather than Spring MVC annotated. (There are various articles a quick Google will uncover on accessing the Spring context programmatically.)
Here's a cleaned up version of my web.xml (nothing earth-shattering, but perhaps it will have some useful hints for somebody!):