Lifecycle of a request in Spring MVC






  • A request leaves the browser asking for a URL and optionally with request parameters.







  • The request is first examined by DispatcherServlet.







  • DispatcherServlet consults handler-mappings defined in a configuration file and selects an appropriate
    controller and delegates to it to handle the request.







  • The controller applies appropriate logic to process the request which results in some information (a.k.a.
    model). This information is associated with the logical name of a result rendering entity (a.k.a view) and the
    whole is returned as a ModelAndView object along with the request back to DispatcherServlet.







  • DispatcherServlet then consults the logical view name with a view resolving object to determine the actual view
    implementation to use.







  • DispatcherServlet delivers the model and request to the view implementation which renders an output and sends it
    back to the browser.







  • Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

    Make sure to activate your subscription by clicking on the activation link sent to your email