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.
Spring MVC framework enables separation of modules namely Model, View, and Control and seamlessly handles the application integration. This enables the developer to create complex applications also using plain java classes. The model object can be passed between view and controller using Maps.
As seen in earlier section, the web container directs all MVC request to the Spring DispatcherServlet. The Spring Front controller will intercept the request and will find the appropriate handler based on the handler mapping (configured in Spring configuration files or annotation).
There is a Front Controller pattern and the Front Controller in Spring MVC is DispatcherServlet. Upon every incoming request from the user, Spring manages the entire life cycle as described in here. In the overall view, DispatcherServlet dispatches the request to a controller for a service at the back-end.
DispatcherServlet
.DispatcherServlet
will take the help of HandlerMapping
and get to know the @Controller
class name associated with the given request.@Controller
, and then @Controller
will process the request by executing appropriate methods and returns ModelAndView
object (contains Model data and View name) back to the DispatcherServletDispatcherServlet
send the model object to the ViewResolver
to get the actual view page.DispatcherServlet
will pass the Model object to the View page to display the result.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With