1、关于扫描器basePackage 模糊匹配
由于模式匹配默认采用了AntPathMatcher实现进行解析,它遵循如下规则
?
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"
Examples
com/t?st.jsp
— matchescom/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
pathorg/**/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