Allow to customize separator for messaging destinations

In order to be able to use separators like "." (used by default
by most broker relays) instead of "/" for destination patterns
handling, the PathMatcher used in spring-messaging can now
be customized easily thanks to XML websocket namespace
or JavaConfig.

AntPathMatcher has been updated in order to use the configured path
separator instead of an hardcoded "/" for path concatenation.
Extension handling is now disabled when the "." separator is configured.

Issue: SPR-11660
This commit is contained in:
Sebastien Deleuze
2014-07-10 15:31:50 +02:00
committed by Rossen Stoyanchev
parent b676c41805
commit 928a466b5d
25 changed files with 967 additions and 79 deletions

View File

@@ -606,4 +606,10 @@ public class AntPathMatcherTests {
assertTrue(pathMatcher.stringMatcherCache.isEmpty());
}
@Test
public void noExtensionHandlingWithDotSeparator() {
pathMatcher.setPathSeparator(".");
assertEquals("/*.html.hotel.*", pathMatcher.combine("/*.html", "hotel.*"));
}
}