Interceptors and difference filters:
1, the interceptor (Interceptor) detachment action request function, and the filter (filter) for almost all the requests can act
after 2, the filter is a request to enter the container (the Tomcat), but before entering the request servlet, request the return is the same end, after Servlet is processed, returned to the Tomcat
3, Aop: interceptors and filters are actually solid line Aop programming ideas, can be embodied permission checks, diary records; but the differences:
1, different scope of application: filter is specified Servlet specification, the user can only wen program, and both interceptors can be used in the web, and can be used in the application, swing program.
2, different specification: filter is predetermined Servlet specification, the Servlet container is supported. Spring is in the interceptor vessel, the Spring framework support.
3, the use of different resources:
4, at different depths.
One,
Two,
Three,
Four,
Filter: filter interceptors: interceptor
Guess you like
Origin blog.csdn.net/JokercFly/article/details/104607723
Ranking