(1) filter (Filter): When you have a bunch of stuff, you just want to choose something that you comply with certain requirements. Tool definition these requirements, is a filter. (Understood: take a pile of letters B)
(2) interceptor (Interceptor): In an ongoing process, you want to interfere with its progress, or even terminate it for, this is the interceptor to do. (Understand: a pile of letters in his intervention, authenticated fewer points the way to doing something else).
a.preHandle () This method step is performed before the filter chain.doFilter (request, response) method, that is, [System.out.println ( "before ...")] [chain.doFilter (request , response) executed between].
After b.preHandle () method, before the return ModelAndView be, you can manipulate the contents of the Controller ModelAndView.
c.afterCompletion () method is returned to step performed before the front end of the filter, i.e. in [chain.doFilter (request, response)] [System.out.println ( "after ...")] between execution.
3.SpringMVC mechanism is different from the Controller Servlet to distribute the request for the same, in fact, this step is performed in the Servlet's service () method. So filters, interceptors, service () method, the order of execution dispatc () method should be such that roughly drew a diagram: In fact, very good test, write a filter, a blocker, then these methods all add breakpoint, all the way down to F8 concluded.
4.SpringMVC mechanism is different from the Controller Servlet to distribute the request for the same, in fact, this step is performed in the Servlet's service () method.
5., SpringMVC mechanism is different from the Controller to distribute requests to the same Servlet, in fact, this step is performed in the Servlet service () method.
6.SpringMVC mechanism is different from the Controller Servlet to distribute the request for the same, in fact, this step is performed in the Servlet's service () method.
7. Also, the interceptor vessel is spring, spring is supported,