스프링 4의 다른 WebSocket 접근 방식을 테스트하고 있습니다. 그러나 때스프링 4 WebSockets + SockJS - websocket : 핸드 셰이크 인터셉터가 전혀 호출되지 않았습니다.
[...]
try {
Map<String, Object> attributes = new HashMap<String, Object>();
if (!chain.applyBeforeHandshake(request, response, attributes)) {
:
여기<websocket:handlers>
<websocket:mapping path="/simpleChatHandler" handler="simpleChatHandler"/>
<websocket:handshake-interceptors>
<bean class="org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor"/>
</websocket:handshake-interceptors>
</websocket:handlers>
이 인터셉터는 org.springframework.web.socket.server.support.WebSocketHttpRequestHandler.handleRequest()
에 호출된다
가장 기본적인은 인터셉터 (I은 HttpSession이 속성을 게시 할)를 호출, 잘 작동 SockJS 핸들러를 사용하면 인터셉터는 호출되지 않습니다.
<websocket:handlers>
<websocket:mapping path="/simpleChatHandlerSockJS" handler="simpleChatHandler"/>
<websocket:handshake-interceptors>
<bean class="org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor"/>
</websocket:handshake-interceptors>
<websocket:sockjs/>
</websocket:handlers>
WebSocketHttpRequestHandler
과 달리 org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler
에는 "인터셉터"속성이없는 것으로 보입니다.
이것은 스프링 버그입니까? SockJS 웹 소켓에 HttpSessionAttributes를 게시하는 방법을 알고 있습니까?
sockjs 요소를 정의 할 수 없습니다 (org.xml.sax.SAXParseException). 스키마는 허용하지 않습니다. 나는 인터셉터 지원이 실제로 sockjs를 사용할 때 구현되지 않는다고 생각합니다 ... – codependent