本文介绍了Spring 4 MVC和Websockets - 没有合适的默认RequestUpgradeStrategy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要Websockets进行实时更新。所以我找到了这个例子并且一步一步做了。

我搜索了很多,但我没有找到解决方案。

我希望任何人都可以提前帮助我。

祝好,帕特里克 解决方案

通过添加以下maven依赖项:

 <依赖项> 
< groupId> org.apache.tomcat.embed< / groupId>
< artifactId> tomcat-embed-websocket< / artifactId>
< version> 7.0.52< / version>
< /依赖关系>

正如Craig Otis指出的那样,如果您计划部署到Tomcat,您应该使用< scope> test< / scope> ,以确保您不会在构建工件中包含依赖项。


I need Websockets for real-time updates in my application. So i found this example and did it step by step here. I went through the tutorial and finally i got this exception when starting the application:

I have searched a lot, but i didn't find a solution.

I hope anyone can help me, thanks in advance.

best regards, patrick

解决方案

I managed to resolve this issue by adding the following maven dependency:

<dependency>
   <groupId>org.apache.tomcat.embed</groupId>
   <artifactId>tomcat-embed-websocket</artifactId>
   <version>7.0.52</version>
</dependency>

As pointed by Craig Otis, if you're planning on deploying to Tomcat anyway, you should use <scope>test</scope> to ensure you don't include the dependency in your build artifact.

这篇关于Spring 4 MVC和Websockets - 没有合适的默认RequestUpgradeStrategy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 06:01