Header Ads

test

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.DispatcherServlet makes           a request to HandlerMapping to identify the particular                controller for the given url.
3. HandlerMapping identifies the controller for the given request and sends to the DispatcherServlet.
4.DispatcherServlet will call the handleRequest(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 bussiness requirement.
6. Service class  calls the Dao class method for the business data
7. Dao interact 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 ModelAndView object back to the Front Controller.
12.The Front Controller i.e., DispatcherServlet then tries to resolve the actual View(which may be Jsp,Velocity or Free marker) by consulting the ViewResolver object.
13.ViewResolver selected View is rendered back to the DispatcherServlet.
14.DispatcherServlet consult the particular View with the Model.
15.View executes and returns HTML output to the DispatcherServlet.
16.DispatcherServlet sends the output to the Browser.

1 comment: