Explain the concept of Interceptors in Spring MVC?

Handler interceptors are used when you want to apply specific functionality to certain requests. Handler Interceptors should implement the interface HandlerInterceptor.

Three methods are defined:

  • preHandle(..) is called before the actual handler is executed;
  • postHandle(..) is called after the handler is executed;
  • afterCompletion(..) is called after the complete request has finished.

spring 12

FOLLOW US ON LinkedIn



Explore Tutu'rself