top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Spring MVC Interceptor in java and how to use it?

+1 vote
536 views
What is Spring MVC Interceptor in java and how to use it?
posted Aug 24, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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.

answer Aug 29, 2017 by Pooja Singh
...