前言
filter和拦截器的执行顺序
顺序
- filter先于拦截器, 而且filter的执行顺序取决于声明的顺序
调用顺序
request –> filter1 –> filter2 –> interceptor1 –> interceptor2 –> dispatcherServlet
–> controller – modelAndView –> dispatcherServlet –> 视图渲染 –> interceptor2(afterCompletion)
–> interceptor1(afterCompletion) –> filter2 –> filter1