Spring Web MVC flow

  1. Prgrammer deploys the spring web MVC application to the web-server or Application Server.
  2. Deployment actions takes place on the DispatcherServlet & its supplied IOC container.
  3. Then browser gives request by having url.
  4. As FrontController configured with url-pattern as directory match or extension match, it will traps and takes the request and applies common system services.
  5. Then it hand overs the request to the Handler mapping component, and Handler mapping component will maps that rquest URI to the specific Handler class.
  6. And return the bean id of Handler class to DispatcherServlet.
  7. Then the DispatcherServlet managed IOC container will call the getBean() method and gets Handler class object.
  8. Then DispatcherServlet calls Handler class method on Handler class object, and delegates the request to Handler class.
  9. If request from form page(having request params) then Handler class internally writes the form data to the command class object(a kind of Java bean).
  10. Handler class either directly process the rquest or passes the request to the service for request processing and keeps the generated result/output and Logical view name in ModelAndView class object.
  11. Then method of Handler class returns MAV(ModelAndView) object to DispatcherServlet.
  12. After receiving MAV object DispatcherServlet collects results from MAV object and keeps in request scope and then collects logicalview name for passing to ViewResolver component.
  13. Then DispatcherServlet passes the (logical view name) to ViewResolver.
  14. ViewResolver resolves the name, location and technology of View Resource like jsp page and returns view object having physical view name & location to DispatcherServlet.
  15. After receiving view object from ViewResolver, DispatcherServlet calls render() method on it.
  16. After calling the render() method on view object, it transfers the control to Physical view resource component like(jsp, html pages).
  17. Physical view Resource collects results data from request scope and formats it to send to browser as response.
  18. Browser receives the response and displays it as web page.


Share:

No comments:

Post a Comment

Quote of the day

Popular Posts

Featured Post

Collection Framework Overview

Collection:- A collection (sometimes called a container) is simply an object that groups multiple elements into single unit. Collect...

Youtube Page

Facebook Page

Recent Posts

About

I am Shivaji Chandra and I'm a Computer Science Engineer. I love to write poems, jokes and quotes. click here →