/** * Implementation of <code>javax.servlet.FilterChain</code> used to manage * the execution of a set of filters for a particular request. When the * set of defined filters has all been executed, the next call to * <code>doFilter()</code> will execute the servlet's <code>service()</code> * method itself. * * @author Craig R. McClanahan * @version $Revision: 1.10.2.1 $ $Date: 2001/10/12 01:57:41 $ */如果回复链里没有其它过滤器可调用的话,就会调用servlet的service()方法
只有多个filter 才可以chain.doFilter() 不然返回false
如果过滤器链表里没有其它过滤器的话,这个过滤链的调用就会转到其它资源的调用。
FilterChain是由容器来管理的!
* Implementation of <code>javax.servlet.FilterChain</code> used to manage
* the execution of a set of filters for a particular request. When the
* set of defined filters has all been executed, the next call to
* <code>doFilter()</code> will execute the servlet's <code>service()</code>
* method itself.
*
* @author Craig R. McClanahan
* @version $Revision: 1.10.2.1 $ $Date: 2001/10/12 01:57:41 $
*/如果回复链里没有其它过滤器可调用的话,就会调用servlet的service()方法
我基本理解你们的解释了。dawnwang(晓风) ,我说的目的地资源是书上说的,FilterChain会传递到下一个filter或者链末端的资源中。就是目的地资源吧。
目的地资源就是你所请求的资源,只有前面的所有过滤器都通过后,才会转向你请求的资源.举个例子来说,你发出一个url请求,然后有一堆过滤器对你进行身份验证,只有这些验证全部通过后,才会转向你所请求的页面.