-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add option to configure PathPatternParser in Spring MVC #21694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've been working on this change and I've found some failures in our build. As underlined by Spring Framework in its docs, some configuration options/combinations are not supported with the
Note that So from a Spring Boot perspective, I'm wondering how we should work with that.
|
Because there are many possible sources of issues when switching to We're going to introduce a new configuration option that allows developers to switch to |
As of Spring Framework 5.3 (See spring-projects/spring-framework#24945), it will be possible to use
PathPatternParser
to parse and match request mapping path patterns, as an alternative to the current defaultAntPathMatcher
.This new implementation has been used for a while already in Spring WebFlux and is stable.
It’s been designed for consistency and performance, fixing issues we’ve seen in the past with the
AntPathMatcher
variant.We should consider switching to this new variant in MVC; there are behavior differences and incompatible changes between the two. For example, double wildcards are rejected when used in the middle of the pattern. See spring-projects/spring-framework#24952
We could offer a new configuration property for switching between the two implementations and even choose
PathPatternParser
as the default one. In case existing applications use invalid patterns, aPatternParseException
will be raised during application startup - we could create a dedicated failure analyzer to guide developers in those cases: fix the pattern if possible or switch back the implementation using the new property.Edit: in the meantime, a blog post explaining these changes has been published.
The text was updated successfully, but these errors were encountered: