πŸƒFilter vs Interceptor

Describe about Filter and Interceptor in Spring boot

From this image , Filter isn't a part of Spring framework. It mainpulates request and response. It can block the request from client and also block response before reach client.

Interceptor is similar to Filter but it will intercept request between Dispatcher Servlet and Controller

Use Case Filter

  • Authentication

  • Logging and auditing

Use Case Interceptor

  • Detailed authorization checks

  • Manipulating the Spring context or model

Last updated