在Web.xml中配置Filter的过滤路径时,可否exclude某些路径?
不可以。[u]there isn't an exclude pattern in the servlet spec[/u].
You would need to do it from within your Filter code.在doFilter中对路径进行判断处理。例如
不可以。[u]there isn't an exclude pattern in the servlet spec[/u].
You would need to do it from within your Filter code.在doFilter中对路径进行判断处理。例如
doFilter(ServletRequest req, ServletResponse res, FilterChain chain) {
if(req instanceof HttpServletRequest) {
HttpServletRequest hreq = (HttpServletRequest)req;
if(hreq.getRequestURI().endsWith("aaa.do"){
// do something
}
}
chain.doFilter(req, res);
}