且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Websocket:从SimpMessagingTemplate接收不到任何东西

更新时间:2023-02-26 17:38:16

感谢此处的***帖子

Thanks to this *** post here Loading both mvc-dispatcher-servlet.xml and applicationContext.xml?, I managed to merge the duplicates in the dispatcher-servlet and applicationContext XML's.

诀窍就是像这样将applicationContext导入dispatcher-servlet中:

The trick was simply to import the applicationContext in the dispatcher-servlet like this :

<import resource="applicationContext.xml" />

,并删除所有重复项(显然不要触摸applicationContext.xml中的任何标签).

, and to remove all the duplicates (not touching any tag in applicationContext.xml obviously).

自该项目开始以来,我就一直存在这个部分配置重复的问题,并计划在以后将其删除-当时尝试了导入,但是那时我没有做到这一点. 现在这个Websocket问题迫使我再试一次(复制以前没有阻塞),而且令人惊讶的是它运行得很好,我想我在第一次尝试时犯了一个愚蠢的错误,因为它实际上是很琐碎的:)

I had this partial configuration duplication issue hanging since the beginning of this project and planned to remove it later on - tried the import at that time but I did not manage to do it back then. Now this Websocket issue forced me to try it again (duplicating was not blocking before), and surprisingly it worked perfectly, I suppose that I made a silly mistake during the first try, since it was in fact rather trivial :)