Skip to main content

preHandle()

Learn preHandle() (Interceptors, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes preHandle() is the HandlerInterceptor method that runs before the controller; its signature is boolean preHandle(request, response, handler) . Return value : true continues the chain to the next interceptor and the controller; false stops it. Typical use : authentication, rate limiting, request logging and setting request attributes.

More lessons in Interceptors