Add documentation about URI variables in AntPathMatcher [SPR-14652] #19218
Comments
Brian Clozel commented Thanks Bob Tiernay for raising this. I've added documentation in the places you suggested. I've tried changing the If you find a concrete case (URL mapping) that looks like it, please file a new ticket and we'll look into it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bob Tiernay opened SPR-14652 and commented
Currently, there is no mention of URI variables / regexes in
AntPathMatcher
:However, more complicated expressions are possible using regexes within braces:
This deserves mentioning because it is a very powerful feature that allows one to do things like negative lookahead assertions, etc.
Also, it might be nice to add Javadocs to
ViewControllerRegistry#addViewController
andResourceHandlerRegistry#addResourceHandler
that mention that regexes are supported. I would expect a lot of Spring MVC users use these methods and are unaware that this is possible (like myself). This could free users from having to bring in third party libs like the urlrewrite filter for a lot of use cases. A common example is HTML5 pushState mode with an angular SPA:which maps all URLs to index.html.
Lastly, it may be worth reviewing the
isPattern
method to ensure all patterns are covered:Notice in the above there is no check for a brace character which is one of the valid metacharacters. My concern is that this may not cover patterns such as the following which neither contain '*' nor '?':
Referenced from: commits a8ba065, f3dae0c
The text was updated successfully, but these errors were encountered: