Friday, June 9, 2017

Spring MVC workflow Overview Spring MVC Execution Flow Diagram Java High Q


Spring MVC workflow overview














1)The client requests for a Resource in the web application.


2) The sprint front controller i.e DistacherServlet 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 handlerRequest (req, res) method on Controller. Controller is developer 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 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 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.


14)ViewReslover selected View is rendered back to the DispatcherServlet.

15)DispatcherServlet consult the particular View with the Model.


16)View executes and returns HML output to the DispatcherServlet.

17)DistpatcherServlet sends the output to the Browser.



 

No comments:

Post a Comment