Monday, 26 February 2018

11.0 SPRING MVC

SPRING MODEL VIEW CONTROLLER




















  • Client send a reqeust through web Application.
  • DispatcherServlet which is the first controller receives the request.
  • DispatcherServlet consults the HandlerMapping to identify the particular controller for the given URL.
  • HandlerMapping identifies the controller for the given request and sends to the DispatcherServlet.
  • DispatcherServlet will call the handleRequest(request,response) method on Controller. A Controller is developed by writing a simple java class which implements Controller interface or extends its adapter class.
  • Controller will call the business method according to business requirement.
  • Service class will call the DAO class method for business data.
  • DAO interacts with DB to get data.
  • DAO returns same data to service.
  • Fetched data will be processed according to business requirement and return results to Controller.
  • The Controller returns the Model and View in the form of Object back to the Controller i.e, DispatcherServlet.
  • The front controller i.e, DispatcherServlet then tries to resolve the actual View which may be JSP,velocity or Free Marker by consulting the View Resolver Object.
  • ViewResolver selected view is rendred back to the DispatcherServlet.
  • DispatcherServletconsult the particular view with the model.
  • View executes and returns HTML output to the DispatcherServlet.
  • DispatcherServlet will sends the output to the Browser.

No comments:

Post a Comment