知识库--ApplicationFilterChain(54)
2016-12-18 23:33
281 查看
ApplicationFilterChain
The org.apache.catalina.core.ApplicationFilterChain class is the implemetation of the javax.servlet.FilterChain interface. The invoke method in the StandardWrapperValve class creates an instance of this class and calls its doFilter method. The ApplicationFilterChain class’s doFilter method calls the doFilter method of the first filter in the chain. The Filter interface’s doFilter method has the following signature:
The doFilter method of the ApplicationFilterChain class passes itself as the third argument to the filter’s doFilter method.
From its doFilter method, a filter can cause the invocation of another filter by explicitly calling the doFilter method of the FilterChain object. Here is an example of the doFilter method implementation in a filter.
//如果doFilter调用的是最后一个filter,接下来将会调用 servlet的service方法。
The org.apache.catalina.core.ApplicationFilterChain class is the implemetation of the javax.servlet.FilterChain interface. The invoke method in the StandardWrapperValve class creates an instance of this class and calls its doFilter method. The ApplicationFilterChain class’s doFilter method calls the doFilter method of the first filter in the chain. The Filter interface’s doFilter method has the following signature:
public void doFilter(ServletRequest request,ServletResponse respponse, FilterChain chain)throws IOException,ServletException
The doFilter method of the ApplicationFilterChain class passes itself as the third argument to the filter’s doFilter method.
From its doFilter method, a filter can cause the invocation of another filter by explicitly calling the doFilter method of the FilterChain object. Here is an example of the doFilter method implementation in a filter.
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // do something here ... chain.doFilter(request, response);
//如果doFilter调用的是最后一个filter,接下来将会调用 servlet的service方法。
相关文章推荐
- 知识库--ApplicationFilterConfig+FilterConfig实践(54)
- How Tomcat works之第十一章之ApplicationFilterChain
- Spring Security Web Application 之 Security Filter Chain
- 知识库--web.xml 中的 FilterDef(54)
- Spring Security Filter Chain Registration Using WebApplicationInitializer for Servlet 3.x
- Tomcat 的 ApplicationFilterChain
- How Tomcat works之第十一章之ApplicationFilterChain
- No bean named 'springSecurityFilterChain' is defined 问题解决
- ISA Server Application Filter Object Model
- Filter及FilterChain的使用具体解释
- No bean named 'springSecurityFilterChain' is defined 解决
- Filter Chain Pattern
- shiro配置filterchaindefinitions实现多角色判定方法的重写
- Filter及FilterChain的使用详解
- 利用Application.AddMessageFilter屏蔽消息
- Under Windows8 kernel mode development NDIS application-NDIS Filter explain
- spring security源码分析之一springSecurityFilterChain
- Filter和FilterChain具体的使用说明
- WebSphere Application Server8.5中Filter没有在Servlet之前初始化的解决方法
- SecurityFilterChain