码迷,mamicode.com
首页 > 其他好文 > 详细

过滤器配置

时间:2014-09-09 18:14:49      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   ar   div   sp   log   

配置过滤器在servlet前执行。

 1         <filter>  
 2                 <filter-name>HiddenHttpMethodFilter</filter-name>  
 3                 <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>  
 4         </filter>  
 5         <filter-mapping>  
 6                 <filter-name>HiddenHttpMethodFilter</filter-name>  
 7                 <servlet-name>spring</servlet-name>  
 8         </filter-mapping>
 9         <servlet>
10         <servlet-name>spring</servlet-name>
11         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
12         <init-param>
13             <param-name>contextConfigLocation</param-name>
14             <param-value>classpath:dispatcher.xml</param-value>
15         </init-param>
16     </servlet>
17         <servlet-mapping>
18         <servlet-name>spring</servlet-name>
19         <url-pattern>*.html</url-pattern>
20     </servlet-mapping>

 

    <filter>
        <filter-name>HibernateFilter</filter-name>
        <filter-class>my.package.HibernateThreadFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>HibernateFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 

过滤器配置

标签:style   blog   http   color   io   ar   div   sp   log   

原文地址:http://www.cnblogs.com/javaleon/p/3963039.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!