I want to open the websocket port using the path "webapp / socket.do". When I use SockJS and try to initiate a call by code
var socket = new SockJS('/webapp/socket.do'); stompClient = Stomp.over(socket); stompClient.connect({}, ...
SockJS will add "/ info" to the end of this path by default. I want to know why? Can this be changed or prevented?
When using this with Spring MVC and url pattern mappings in DispatcherServlet, like < url-pattern >*.do</url-pattern> , it will return a 404 error. It is blocked due to the "/ info" line added by sockJS to the specified URL to the address.
Spring servlet mapping code web.xml:
<servlet-mapping> <servlet-name>dispatch-servlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
Does anyone know what sockJS is trying to do and why?
source share