You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setPathMatcher(new ParsingPathMatcher());
}
2017-03-01 17:43:51.763 ERROR 3503 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.util.patterns.PatternParseException: No more pattern data allowed after {*...} pattern element] with root cause
org.springframework.web.util.patterns.PatternParseException: No more pattern data allowed after {*...} pattern element
at org.springframework.web.util.patterns.InternalPathPatternParser.parse(InternalPathPatternParser.java:157) ~[spring-web-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.util.patterns.PathPatternParser.parse(PathPatternParser.java:68) ~[spring-web-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.util.ParsingPathMatcher.getPathPattern(ParsingPathMatcher.java:115) ~[spring-web-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.util.ParsingPathMatcher.match(ParsingPathMatcher.java:50) ~[spring-web-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getMatchingPattern(PatternsRequestCondition.java:253) ~[spring-webmvc-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getMatchingPatterns(PatternsRequestCondition.java:230) ~[spring-webmvc-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getMatchingCondition(PatternsRequestCondition.java:211) ~[spring-webmvc-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.mvc.method.RequestMappingInfo.getMatchingCondition(RequestMappingInfo.java:220) ~[spring-webmvc-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.getMatchingMapping(RequestMappingInfoHandlerMapping.java:94) ~[spring-webmvc-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]
...
The problem is that the request matcher tries to match "/something/{path}." (suffix matching) or "/something/{*path}/" (trailing slash).
but why should the user have to know about how to do that? If the user does have to know this, then the error message is completely cryptic, and maybe we can come up with a better one.
Since changing the configuration behind the user's back or silently ignoring the exceptions were not good options, I've added a configuration check in the PathMatchConfigurer to throw an exception explaining the issue.
Dave Syer opened SPR-15303 and commented
With this request mapping:
This doesn't work:
The problem is that the request matcher tries to match "/something/{path}." (suffix matching) or "/something/{*path}/" (trailing slash).
This does work:
but why should the user have to know about how to do that? If the user does have to know this, then the error message is completely cryptic, and maybe we can come up with a better one.
Affects: 5.0 M5
Issue Links:
Referenced from: commits 0557404
The text was updated successfully, but these errors were encountered: