July 2016
Intermediate to advanced
490 pages
10h 54m
English
Interceptors are popular in the Struts 2 framework, but Spring MVC can implement interceptors to manage sessions, logging, and auditing a user authentication process. The concept of an interceptor is similar to the filters in a typical Java Enterprise model but not exactly the same.
In order to create a handler interceptor, we must make use of org.springframework.web.servlet.HandlerInterceptor. The HandlerInterceptor defines three methods that can be used for pre-processing and post-processing requests:
PreHandle: This is called before a URL is executed, and returns a Boolean value. When it returns true, the handler execution chain continues, whereas when it returns false, the DispatcherServlet stops the execution of the entire ...Read now
Unlock full access