ant style介绍和在spring中的应用

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

例子一览

  1. */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)
    
  2. 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.xml

    But not:
    org/apache/xyz.java

    (jakarta/ part is missing).

  3. 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/Entries

    But not:
    org/apache/CVS/foo/bar/Entries

    (foo/bar/ part does not match)

  4. /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>

参考文章

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值