Authentication Interceptor
Learn Authentication Interceptor (Interceptors, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes Authentication interceptor : checks in preHandle() that the caller is logged in and rejects the request otherwise. For session apps check a session attribute and redirect to /login ; for APIs check a token header and reply 401 Unauthorized . Return false after sending the redirect or error, so the controller is never reached.