1.

What are the important annotations use to create the interceptor and what all their annotation does?

Answer»

INTERCEPTOR is one of the prominent features of spring boot and must use the @COMPONENT annotated class that supports it and it should implement the HandlerInterceptor interface.

There are three methods which are USED to implement the interceptor.

  • preHandle() method − This method is predominantly used  to perform the operation by intercepting the call and getting the information present in the REQUEST.
  • postHandle() method − This method is used  to perform the operation by intercepting  the call information present in the response.
  • afterCompletion() method − This is used to perform OPERATIONS when the request and response get completed.


Discussion

No Comment Found