Sunday, 10 November 2019

Spring MVC Execution Flow Diagram




The Spring MVC Workflow overview

 1.    The Client requests for a Resource in the web Application.

2.    The Spring Front Controller i.e.Dispatcher Servlet makes a request to Handler Mapping to identify the particular controller for the given url.

3.     Handler Mapping identifies the controller for the given request and sends to the Dispatcher Servlet.

4.    DispatcherServlet will call the handle Request(req,res) method on Controller. Controller is developed by writing a simple java class which implements Controller interface or extends any controller class.

5.    Controller will call the business method according to business requirement.

6.    Service class  calls the Dao class method for the business data

7.    Dao interacts with the Database to get the database data.

8.    Database gives the result.

9.    Dao returns the same data to service.

10. Dao given data will be processed according to the business requirements, and returns the results to Controller.

11. The Controller returns the Model and the View in the form of Model and View object back to the Front Controller.

12. The Front Controller i.e., Dispatcher Servlet then tries to resolve the actual View(which may be Jsp,Velocity or Free marker) by consulting the View Resolver object.

13. ViewResolver selected View is rendered back to the Dispatcher Servlet.

14. DispatcherServlet consult the particular View with the Model.

15. View executes and returns HTML output to the Dispatcher Servlet.

16. DispatcherServlet sends the output to the Browser.


Share This

0 komentar: