Spring AntPathMatcher 实现原理
最近在看Spring 源码,源码中多次出现AntPatternMatcher 类, 此类作用用于实现对URL的匹配 关于此类的介绍,其中有些代码是从Apache Ant 那 "借"过来的 PathMatcher implementation for Ant-style path patterns. Examples are provided below. Part of this mapping code has been kindly borrowed from Apache Ant . The mapping matches URLs using the following rules: ? matches one character * matches zero or more characters ** matches zero or more 'directories' in a path Some examples: com/t?st.jsp - matches com/test.jsp but also com/tast.jsp or com/txst.jsp com/*.jsp - matches all .jsp files in the com directory com/**/test.jsp - matches all test.jsp files