Overview of the Spring MVC request flow

The main entry point for a web request in a Spring MVC application is via the Dispatcher servlet. The Dispatcher servlet acts as a front controller and dispatches the requests to the other controller. The front controller's main duty is to find the appropriate right controller to hand over the request for further processing. The following diagram shows an overview of the request flow in a Spring MVC application:

Overview of the Spring MVC request flow

The Spring MVC request flow

Okay, let's review the Spring MVC request flow in short:

  1. When we enter a URL in the browser, the request comes to the Dispatcher servlet. The Dispatcher servlet acts as a centralized entry point to the web application.
  2. The Dispatcher servlet determines a suitable controller that is capable of handling the request and dispatching that request to the controller.
  3. The controller method updates the objects in the model and returns the logical view name and updated model to the Dispatcher servlet.
  4. The Dispatcher servlet consults with view resolver to determine which view to render and passes the model's data to that view.
  5. View furnishes the dynamic values in the web page using the model's data and renders the final web page and returns that web page to the Dispatcher servlet.
  6. At the end, the Dispatcher servlet returns the final rendered page as a response to the browser.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.20.193