DispatcherServlet is part of the Spring MVC. It works as a front controller, that is, it handles all the incoming HTTP requests. Spring MVC is a web framework that allows you to develop traditional web applications where UI apps are also part of the backend. However, you'll develop RESTful web services and the UI will be based on the React JavaScript library, therefore we'll keep the Servlet Dispatcher role limited to implementing the REST endpoints using @RestController.
Let's have a look at the flow of a user request in Spring MVC for the REST controller:
The user sends the HTTP request, which is received by DispatcherServlet.
DispatcherServlet passes the baton to HandlerMapping. HandlerMapping does the job of finding the correct controller for the requested URI and passes it back to DispatcherServlet.
DispatcherServlet then makes use of HandlerAdaptor to handle Controller.
HandlerAdaptor calls the appropriate method inside Controller.
Controller then executes the associated business logic and forms the response.
Spring makes use of the marshaling/unmarshalling of request and response objects for JSON/XML conversion from Java and vice versa.