Exploring the Dispatcher Servlet
What is the Dispatcher Servlet? The Dispatcher Servlet is at the heart of Spring MVC. It is responsible for receiving client requests, delegating them to the appropriate controller, and then passing the result returned by the controller to the view. There is only one Dispatcher Servlet in a web application, and it handles all client requests. How the Dispatcher Servlet Works Receives a request from the client. Finds the controller that will handle the client’s request through Handler Mapping. Executes the controller through Handler Adapter. Transforms the result returned by the controller into a View through View Resolver. Forwards the view to the client. When using RestController, View Resolver is not used. Instead, the object is converted to JSON format and sent to the client. ...