It processes requests in the following way:
A web request is received by DispatcherHandler.
DispatcherHandler uses HandlerMapping to find a matching handler for the request and uses the first match.
It then uses the respective HandlerAdapter to process the request, which exposes the HandlerResult (return value after processing). The return value could be one of the following – ResponseEntity, ServerResponse, values returned from @RestController, or values (CharSequence, view, map, and so on) returned by a view resolver.
Then, it makes use of the respective HandlerResultHandler to write the response or render a view based on the HandlerResult type received from step 2. ResponseEntityResultHandler is used for ResponseEntity, ServerResponseResultHandler is used for ServerResponse, ResponseBodyResultHandler is used for values returned by @RestController or @ResponseBody-annotated methods, and ViewResolutionResultHandler is used for values returned by the view resolver.
The request is completed.