spring
Lifecycle of a REST request in Spring Boot (DispatcherServlet).
- Request Received: The request hits the
DispatcherServlet. - Handler Mapping: The servlet consults
HandlerMappingto find which Controller method should handle the request. - Handler Adapter:
DispatcherServletusesHandlerAdapterto invoke the method. - Controller Execution: Logic runs inside your
@Controller. - View Resolver: (If MVC) Result is resolved to a view. (If REST) The result is directly serialized into the response body by message converters.
- Response Sent: The response is sent back to the client.