Filter配置多个url-pattern

java开发中会用的Filter过滤器,有时候开发需要,在一个Filter中需要配置多个过滤地址,即<url-pattern>,下面就说一下一个Filter过滤器中多个<url-pattern>的配置方法:

<filter>
    <filter-name>CORSFilter</filter-name>
    <filter-class>xxx.filter.CORSFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>CORSFilter</filter-name>
    <url-pattern>/pages/aaa/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CORSFilter</filter-name>
    <url-pattern>/pages/bbb/*</url-pattern>
</filter-mapping>

 

posted @ 2017-06-01 15:42  路常有  阅读(6717)  评论(0编辑  收藏  举报