What are the rules for Ant path style patterns.
The Ant site itself is surprisingly uninformative.
Ant-style path patterns matching in spring-framework:
The mapping matches URLs using the following rules:
?
matches one character*
matches zero or more characters**
matches zero or more 'directories' in a path{spring:[a-z]+}
matches the regexp[a-z]+
as a path variable named "spring"Some examples:
com/t?st.jsp
- matches com/test.jsp but alsocom/tast.jsp
orcom/txst.jsp
com/*.jsp
- matches all.jsp
files in thecom
directorycom/**/test.jsp
- matches alltest.jsp
files underneath thecom
pathorg/springframework/**/*.jsp
- matches all.jsp
files underneath theorg/springframework path
org/**/servlet/bla.jsp
- matchesorg/springframework/servlet/bla.jsp
but alsoorg/springframework/testing/servlet/bla.jsp
andorg/servlet/bla.jsp
com/{filename:\\w+}.jsp
will matchcom/test.jsp
and assign the valuetest
to thefilename
variable
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html