Walk through the path of a request in Spring MVC via the DispatcherServlet?
Short answer
The request passes the filter chain to DispatcherServlet; it asks HandlerMapping for the controller, uses a HandlerAdapter to call the method, then writes JSON or renders a view. Exceptions go to a HandlerExceptionResolver, which is where @ControllerAdvice lives.
3 points to say:
- Filters → DispatcherServlet → HandlerMapping → interceptors → HandlerAdapter → converter or view.
- Argument resolvers bind parameters, message converters read/write the body.
- Exceptions go through
HandlerExceptionResolver(@ControllerAdvice); customize withWebMvcConfigurer, don't add@EnableWebMvc.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.