Spring~ What is the difference between interceptors and filters?

①Interceptors are based on the reflection mechanism of java, while filters are based on function callbacks.
② The interceptor does not depend on the servlet container, and the filter depends on the servlet container.
③Interceptors can only work on action requests, while filters can work on almost all requests.
④Interceptors can access objects in the action context and value stack, while filters cannot.
⑤ In the life cycle of action, the interceptor can be called multiple times, while the filter can only be called once when the container is initialized.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326728439&siteId=291194637