Skip to main content

Mini Project: Interceptor Chain Order and Short-circuiting

Learn Mini Project: Interceptor Chain Order and Short-circuiting (Interceptors, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Interceptor Chain Order and Short-circuiting Problem Two interceptors, authentication and logging, wrap every controller call. Developers must know the exact order of preHandle, postHandle and afterCompletion, what happens when one interceptor stops the chain, and what happens when the controller throws. Requirements Register two interceptors A and B in that order. Print the order of all callbacks for a normal request. Make B stop the request for a blocked URL and show what still runs. Make the controller throw and show afterCompletion receiving the exception. Concepts...

More lessons in Interceptors