0 votes
in Spring by
edited by

What is Spring MVC Interceptor and how to use it?

1 Answer

0 votes
by
Spring MVC Interceptors are like Servlet Filters and allow us to intercept client request and process it. We can intercept client request at three places – preHandle, postHandle and afterCompletion.

We can create spring interceptor by implementing HandlerInterceptor interface or by extending abstract class HandlerInterceptorAdapter.

We need to configure interceptors in the spring bean configuration file. We can define an interceptor to intercept all the client requests or we can configure it for specific URI mapping too. For a detailed example, please refer Spring MVC Interceptor Example.

Related questions

0 votes
asked Jul 27, 2020 in Spring by Robindeniel
0 votes
asked Apr 4, 2021 in Spring by Robindeniel
...