① interceptors are based on the reflection mechanism of Java, and filters are based on function callbacks.
The ② interceptor is not dependent on the servlet container, and the filter relies on the servlet container.
The ③ interceptor only works on action requests, while filters can work on almost all requests.
The ④ interceptor can access the action context, the object in the value stack, and the filter cannot be accessed.
⑤ in the life cycle of an action, interceptors can be called multiple times, and filters can only be called once when the container is initialized
Execution order: Interceptors are wrapped in filters
Suppose there is code in DoFilter: Sout1;dofilter;sout2
Execution order: Sout1-->prehandle-->dofilter (Controller)-->posthandle-->sout2
difference between filter (Java.filter) and Interceptor (Springmvc.interceptor)