Skip to content

Allow configuration of path mapping options for websocket handler mapping (e.g. alwaysUseFullPath) [SPR-11771] #16393

@spring-projects-issues

Description

@spring-projects-issues

zyro opened SPR-11771 and commented

when we got a scenario like this:

  • DispatcherServlet servlet-mapping like \*.do and /stomp/\*
  • stomp endpoint registration on /stomp

the requests will not match because AbstractHandlerMapping.alwaysUseFullPath is false by default and so e.g. a request to /stomp/info will lead to a lookup-path of /info which does not match the sockJS handler-mapping, that gets a pattern of /stomp/**

dirty workaround for me was applicationContext.getBean("stompWebSocketHandlerMapping").setAlwaysUseFullPath(true) when the context is fully loaded.

would be cool to get a chance to configure the handlerMapping itself, or at least the alwaysUseFullPath flag using AbstractWebSocketMessageBrokerConfigurer, without needing to fall back to WebSocketMessageBrokerConfigurationSupport overrding the whole handlerMapping bean.

maybe relevant for webSocketHandlerMapping as well?


Affects: 4.0.4

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions