Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对过滤器的理解是 - 过滤器只能用于预处理,一旦它们的任务完成,它们就会将控制权交给调用的资源,然后控制 nvere 回到过滤器。所以它们永远不能用于后处理?我是对的?请帮忙。
不,你不对。需要预处理和后处理的过滤方法通常如下所示:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { preProcess(request, response); chain.doFilter(request, response); postProcess(request, response; }