DispatcherServlet

DispatcherServlet is one of the core components of the Spring MVC. This works as a front-controller in an application. A front-controller means the Spring MVC receives all incoming requests and forwards these to the Spring MVC controller for processing. This is totally coordinated with the Spring IoC container and accordingly enables you to utilize each element of Spring.

DispatcherServlet handles all the HTTP requests and responses that are designed under the Spring MVC. 

Here's a diagram to illustrate DispatcherServlet:

The succession of occasions relating to an approaching HTTP request to DispatcherServlet is as follows:

  1. The application (as a client) sends a request to DispatcherServlet.
  2. DispatcherServlet asks the related Handler Mapping to call the Controller.

 

  1. The Controller takes requests from DispatcherServlet and calls a relevant service function based on the GET or POST function. The service function sets the model data based on the business logic.
  2. ViewResolver selects the defined View.
  3. The defined View is executed on the application.
..................Content has been hidden....................

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