I can’t find correct client request flow in below syntax.Could someone please clarify what is happening here?
Client(1) --> Dispatcher Servlet(2) --> Handler Mapping(3) --> Controller(4) --> ModelAndView(5) --> viewResolver(6) --> View(7) --> Client(1)
If possible please specify what are the corresponding spring classes/interfaces used in spring MVC process.
Advertisement
Answer
- Request will be received by
DispatcherServlet. DispatcherServletwill take the help ofHandlerMappingand get to know the@Controllerclass name associated with the given request.- So request transfer to the
@Controller, and then@Controllerwill process the request by executing appropriate methods and returnsModelAndViewobject (contains Model data and View name) back to the DispatcherServlet - Now
DispatcherServletsend the model object to theViewResolverto get the actual view page. - Finally,
DispatcherServletwill pass the Model object to the View page to display the result.