SPRING CONCEPTS
MVC handler interceptor
Spring Concepts / MVC handler interceptor
An interceptor participates in MVC handler processing.
Understand the idea
Register the interceptor through MVC configuration. PreHandle can allow or stop handling; postHandle follows successful handler execution before HTML view rendering; afterCompletion runs after completion for the handled flow. Servlet filters wrap the Servlet chain at another layer. Async and exception paths affect callback execution.
A concrete example
filter before → preHandle → controller
→ postHandle → view → afterCompletion → filter afterIn the application
See the independently runnable examples in Stage 30.
A component annotation alone does not register an interceptor for MVC routes.