[size=medium]
OncePerRequestFilter
每一次请求执行一次的过滤器
import org.springframework.web.filter.OncePerRequestFilter;
public class CheckSessionFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
filterChain.doFilter(request, response);
}
}
相应的web.xml配置
<!-- ACL过滤器 -->
<filter>
<filter-name>aclFilter</filter-name>
<filter-class>FilterJava文件</filter-class>
</filter>
<filter-mapping>
<filter-name>aclFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- filter end -->
转载自http://hi.baidu.com/wjx_5893/blog/item/4abd8f4bcc676efe83025ce4.html[/size]
OncePerRequestFilter
每一次请求执行一次的过滤器
import org.springframework.web.filter.OncePerRequestFilter;
public class CheckSessionFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
filterChain.doFilter(request, response);
}
}
相应的web.xml配置
<!-- ACL过滤器 -->
<filter>
<filter-name>aclFilter</filter-name>
<filter-class>FilterJava文件</filter-class>
</filter>
<filter-mapping>
<filter-name>aclFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- filter end -->
转载自http://hi.baidu.com/wjx_5893/blog/item/4abd8f4bcc676efe83025ce4.html[/size]