SPRINGMVC: View and view resolvers

Source: Internet
Author: User

After execution of the request processing method is completed, a Modelandview object is returned, and SPRINGMVC is also assembled internally as a Modelandview object for processing methods that return types such as String,view or Modelmap. It contains a view of the logical name and the model object.

Springmvc with the View parser (Viewresolver) to get the final view object (view), the final view may be JSP, or it may be a view of various representations such as Excel. The processor does not care about what view objects are ultimately taken to render the model data, and the processor focuses on the work of the production model data to achieve full decoupling of MVC.

View is the function of rendering model data, presenting the data in the model data to the customer in some form, the view object is instantiated by the view resolver, and because the view is stateless, they do not have thread security issues.

SPRINGMVC provides different strategies for parsing logical view names, configuring one or more parsing strategies in the spring Web context, and specifying their sequencing, each mapping strategy corresponding to a specific view resolver implementation class. The view parser has a single function: parsing a logical view into a specific view object. All view parsers must implement the Viewresolver interface. Each view resolver implements the ordered interface and opens an order property, which allows the Order property to specify the precedence of the parser, the smaller the order, the higher the priority, and the SPRINGMVC to parse the logical view name in the order of the View parser. The servletexception exception is thrown until the parse succeeds and the View object is returned.

SPRINGMVC: View and view resolvers

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.