访问index.jsp页面之后过滤器执行了,但是并没有输出index.jsp中的内容
@WebFilter(filterName = "AsynFilter", value = {"/index.jsp"},dispatcherTypes={DispatcherType.REQUEST,DispatcherType.ASYNC})
public class AsynFilter implements Filter {
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
throws IOException, ServletException {
System.out.println("start…………AsynFilter");
arg2.doFilter(arg0,arg1); // 放行
System.out.println("end…………AsynFilter");
}
@Override
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
System.out.println("init…………AsynFilter");
}
}
访问index.jsp之后,不会输出index.jsp中的内容,但是会在控制台输出:
end…………AsynFilter
start…………AsynFilter
这是为什么?好像过滤器没有放行一样,不会执行index中的内容