Overview of SPRINGMVC-SPRINGMVC

Source: Internet
Author: User

Overview:

1.Spring is an excellent web framework based on MVC design concept provided by the presentation layer, which is one of the most mainstream MVC frameworks today.

2.Spring MVC uses a set of MVC annotations to make POJO the controller that handles requests without having to implement any interfaces.

3. Support for RESTful URL requests.

4. The loosely coupled pluggable component structure is more scalable and flexible than other MVC frameworks.

Spring MVC consists mainly of Dispatcherservlet, processor mappings, processors (controllers), view parsers, and views. His two cores are two cores:

Processor mapping: Choose which controller to use to process the request.

View parser: Select how the results should be rendered.

SPRINGMVC Working principle:

1. HTTP Request: Client request submitted to Dispatcherservlet.
2. Find the Processor: the Dispatcherservlet controller queries one or more handlermapping to find the controller that handles the request.
3. Call Processor: Dispatcherservlet submits the request to the controller.
4. Call the business process and return the result: After the controller invokes the business logic processing, it returns Modelandview.
5. Process the view map and return the model: Dispatcherservlet queries one or more Viewresoler view resolvers to find the Modelandview specified view.
6. HTTP response: The view is responsible for displaying the results to the client.

Springmvc Interface Explanation:

(1) Dispatcherservlet interface:
Spring provides a front-end controller that all requests have to be distributed uniformly. Before Dispatcherservlet will distribute the request to the spring controller, it needs to navigate to the specific controller using the handlermapping provided by spring.
(2) Handlermapping interface:
Requests the customer to the controller map.
(3) Controller interface:
The above requests need to be handled for concurrent users, so when implementing the Controller interface, you must ensure that threads are secure and reusable.
The controller will process the user request, which is consistent with the role that struts action plays. Once the controller has finished processing the user request, the Modelandview object is returned to the Dispatcherservlet front-end controller, and the model and view are included in Modelandview.
From the macroscopic point of view, Dispatcherservlet is the controller of the whole Web application, and from the microscopic consideration, the controller is a control in the process of single HTTP request processing. Modelandview is the model and view that is returned during the HTTP request.
(4) Viewresolver interface:
Spring provides a view parser (Viewresolver) to look up a View object in a Web app, rendering the result to the customer.

Overview of SPRINGMVC-SPRINGMVC

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.