Sự khác nhau giữa filter trong Servlet và interceptor trong Spring

Chào mọi người, em mới học java spring, đang xem về interceptor trong spring.
Em có tìm hiểu qua nhiều nguồn (stackoverflow, javadoc) nhưng vẫn chưa hiểu rõ vấn đề, mọi người cho em xin một cái nhìn trực quan về sự khác nhau giữa filter và interceptor trong java được không ạ? hoặc có thể giải thích đoạn này được khộng ạ?
https://docs.spring.io/spring/docs/3.0.x/javadoc-api/org/springframework/web/servlet/HandlerInterceptor.html

HandlerInterceptor is basically similar to a Servlet 2.3 Filter, but in contrast to the latter it just allows custom pre-processing with the option of prohibiting the execution of the handler itself, and custom post-processing. Filters are more powerful, for example they allow for exchanging the request and response objects that are handed down the chain. Note that a filter gets configured in web.xml, a HandlerInterceptor in the application context.

As a basic guideline, fine-grained handler-related preprocessing tasks are candidates for HandlerInterceptor implementations, especially factored-out common handler code and authorization checks. On the other hand, a Filter is well-suited for request content and view content handling, like multipart forms and GZIP compression. This typically shows when one needs to map the filter to certain content types (e.g. images), or to all requests.

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?