SPRINGMVC execution Process and principle

Source: Internet
Author: User

Spring's MVC execution principle

 1. Spring Mvc submits all requests to dispatcherservlet, which delegates other modules of the application system to the request To do the real processing work. 2.dispatcherservlet query one or more handlermapping to find the controller4.controller  business logic   is processed and returns a  Modelandview5.dispathcher query one or more viewresolver View parser  The Modelandview object specifies the View object 6. The View object is responsible for rendering back to the client .  

1. Using spring's IOC container, the dependencies between the objects are given to spring, and the coupling between the components is reduced, allowing us to focus more on the application logic

3.AOP is very good support, instant noodles programming to the plane.

The 5.Spring di mechanism reduces the complexity of business object substitution.

The 7.Spring is highly open and does not force reliance on spring, and developers are free to select part or all of spring

SPRINGMVC Execution Process :

    1. User initiated the request to the front-end director (Controller)
    2. The front-end controller does not have the ability to handle business logic and needs to find specific Model object processing (Handler) to find the Handler object (model) in the Processor mapper (handlermapping).
    3. Handlermapping returns the execution chain with 2 sections: ①handler object, ② Interceptor Array
    4. Front executes the handler object after wrapping it through the processor adapter.
    5. Process business logic.
    6. Handler finishes processing the business logic and returns the Modelandview object, where view is the view name and not the real view object.
    7. Return the Modelandview to the front-end controller.
    8. The View parser (Viewresolver) returns a true View object.
    9. (At this point the front controller has both a view and model object data) the front-end controller renders the view based on the model data and view objects.
    10. Returns the rendered view (Html/json/xml).
    11. Generate a response to the user.

SPRINGMVC execution Process and principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.