1.

What is a Spring-boot interceptor? Why do we need this features and is there any real use case scenario where spring boot interceptor fits?

Answer»

Spring boot interceptor is TYPICALLY used to INTERCEPT the request and response call MADE by the UI and microservices-based application, the need of this to add, filter, modified the information contain in request and response.

  • Interceptor in Spring Boot ONE can use to add the request header before sending the request to the controller 
  • Interceptor in Spring Boot can add the response header before sending the response to the client.
  • Spring boot works on the below TECHNIQUE
    • Before sending the request to the controller
    • Before sending the response to the client
    • After completing the request and response.

The real-world use case of spring-boot interceptor is authentication and authorization, where   we filter the information from the request which contain the credential information which use to authenticate and other information like role which require authorization. 



Discussion

No Comment Found