SPRINGMVC Workflow and Component description

Source: Internet
Author: User

1. SPRINGMVC processing process

2. SPRINGMVC Architecture

  2.1 Frame Structure

2.2 Framework Process

1. the user sends the request to the front controller dispatcherservlet.

    2. Dispatcherservlet received a request to call the Handlermapping processor mapper.

    3. The processor mapper finds the specific processor, generates the processor object and the processor interceptor (if any) is returned to Dispatcherservlet.

    4. Dispatcherservlet calls the Handleradapter processor adapter.

    5. The Handleradapter is adapted to invoke a specific processor (controller, also known as a back-end controller).

    6. Controller execution Complete returns MODELANDVIEW.

    7. Handleradapter Returns the execution results returned by the controller Modelandview to Dispatcherservlet.

    8. Dispatcherservlet passes the Modelandview to the Viewreslover view parser.

    9. Viewreslover Parse to return to the specific view.

     Dispatcherservlet Renders the view based on the view (populates the model data into the view Jsp/freemaker ... Medium).

    One . Dispatcherservlet responds to the user.

    

    Give me a chestnut! (I don't know if it's a good fit)

1. the user sends the request to the front controller dispatcherservlet. - Obama wants to Ooxx bin Laden. He couldn't do it himself, so he gave the order to the Secretariat.

    2. Dispatcherservlet received a request to call the Handlermapping processor mapper. -- The Secretariat couldn't get the job done, so the Secretariat found the killer agent! I want a killer!

    3. The processor mapper finds the specific processor, generates the processor object and the processor interceptor (if any) is returned to Dispatcherservlet. -- The assassin agency recommended a killer to the Secretariat.

    4. Dispatcherservlet calls the Handleradapter processor adapter. -The secretariat has provided traffic Bureau with the means to the killers: airplanes, trains, cars. How do you want to go?

    5. The Handleradapter is adapted to invoke a specific processor (controller, also known as a back-end controller). The killer thought, or the plane was fast, so he sat on the plane to find bin Laden.

    6. Controller execution Complete returns MODELANDVIEW. -- put bin Laden into the slaughter, get a head ~

    7. Handleradapter Returns the execution results returned by the controller Modelandview to Dispatcherservlet. -- The traffic bureau on the bloody ~ handed to the secretariat.

    8. Dispatcherservlet passes the Modelandview to the Viewreslover view parser. -- A look at the Secretariat, it's awful, we can't just give the president a look. And found the beauty parlor.

    9. Viewreslover Parse to return to the specific view. - After some packing, give it back to the Secretariat.

     Dispatcherservlet Renders the view based on the view (populates the model data into the view Jsp/freemaker ...  Medium). -- The Secretariat tidied it up and put it in the box.

    One . Dispatcherservlet responds to the user. --to Obama.

2.3 Component Description   

The following components typically provide implementations using the framework:

    Dispatcherservlet: Front Controller

The user request arrives at the front controller, it is equivalent to the MVC pattern C,dispatcherservlet is the entire Process Control center, by it calls other components processing user's request, the Dispatcherservlet existence reduced the coupling between the components.

    Handlermapping: Processor Mapper

Handlermapping is responsible for the user's request to find handler is the processor, SPRINGMVC provides different mapper implementation of different mapping methods, such as: Configuration file mode, interface mode, annotation and so on.

    Handler: Processor

The Handler is the back-end controller of the Dispatcherservlet front-end controller, which is processed under the control of Dispatcherservlet Handler to specific user requests.

because Handler involves specific user business requests, so the general situation requires programmers to develop handler based on business requirements.

    Handladapter: Processor Adapter

through The Handleradapter executes on the processor, which is an application of the adapter pattern that can be performed on more types of processors through the extension adapter.

    View Resolver: Views Parser

View Resolver is responsible for generating the results of the View View (Jsp,freemarker), the view Resolver first resolves the logical view name to the physical view name that is the specific page address, and then generates the View object. The final rendering of the view renders the processing results to the user through the page.

    View: Views

The SPRINGMVC framework provides support for many view view types, including: Jstlview, Freemarkerview, Pdfview, and so on. The most common view we use is JSP.

In general, the model data needs to be presented to the user through page labels or page template technology, and the programmer needs to develop specific pages based on the business requirements.

components that require user development are     Handler (Controller class ),view (jsp/freemarker velocity,thyeleaf)

Springmvc Workflow and component description

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.