I have a wildcard Spring MVC mapping that goes something like this:
@RequestMapping(value="**", method={RequestMethod.GET, RequestMethod.POST})
public void doSomething() {
}
However, defined in a Spring @Configuration file, I have this:
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(pushHandler(), "/websocket").withSockJS();
}
with this, my wildcard handler tries to handle my websocket as well.
How do I get Spring MVC wildcard handler not to match my websocket registration path?
Comment From: wilkinsona
It's controlled by the order of RequestMappingHandlerMapping (default 0) and ServletWebSocketHandlerRegistry (default 1). The lower the value the higher the precedence so, by default, @RequestMappings go before WebSocket handlers. You will have to configure the order of one or the other so that ServletWebsockerHandlerRegistry has higher precedence.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.