filter 配置多个url-pattern
最近在做一个OA项目,考了别人的一段代码,他的action的扩展名是action,我用的是do。
为了实现懒加载,我配置了过滤器:org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
考了别人的代码后,我需要该过滤器同时拦截do和action请求,所以需要配置多个url-pattern
 <filter>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
 </filter>
 <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>*.do</url-pattern>
 </filter-mapping>
 <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>*.action</url-pattern>
 </filter-mapping>
要想为filter配置多个url-pattern,需要为该filter配置多个filter-mapping
                    
                
                
            
        
浙公网安备 33010602011771号