ant style总结
一些字符说明
- ‘*’ 匹配0或多对个字符。
- ‘?’ 匹配一个字符。
- ?和 *可以一起使用。
- Matching is done per-directory.就是说每个目录单独匹配。
比如有表达式, /?abc//.java 具体路径为 /xabc/foobar/test.java, 那么 ?abc is matched with xabc, then * is matched with foobar, and finally *.java is matched with test.java.所以这个路径和表达式是匹配的。 - ** 匹配多个目录。
比如 /test/** 可以匹配 /test/x /test/x/y/z
例子一览
*/CVS/
Matches all files in CVS directories that can be located anywhere in the directory tree.
Matches:
CVS/Repository org/apache/CVS/Entries org/apache/jakarta/tools/ant/CVS/Entries
But not:
org/apache/CVS/foo/bar/Entries (foo/bar/ part does not match)
org/apache/jakarta/**
Matches all files in the org/apache/jakarta directory tree.
Matches:
org/apache/jakarta/tools/ant/docs/index.html
org/apache/jakarta/test.xmlBut not:
org/apache/xyz.java(jakarta/ part is missing).
org/apache/*/CVS/
Matches all files in CVS directories that are located anywhere in the directory tree under org/apache.
Matches:
org/apache/CVS/Entries
org/apache/jakarta/tools/ant/CVS/EntriesBut not:
org/apache/CVS/foo/bar/Entries(foo/bar/ part does not match)
/test/
Matches all files that have a test element in their path, including test as a filename.
ant style 在spring中的应用
mvc intercepter和controller的requestmapping value定义
如下是一个intercepter的定义:
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean class="com.baidu.dsp.common.interceptor.session.SessionInterceptor">
</bean>
</mvc:interceptor>