[Liu Yang java]_spring mvc view Parser _viewresolver_ 5th

Source: Internet
Author: User

All of the We MVC framework has its own mechanism for parsing views, and Spring MVC is no exception, it uses Viewresolver for view parsing, allowing the user to render the model in the browser. Viewresolver is an out-of-the-box technology that resolves multiple views such as JSPs, velocity templates, and XSLT.

The two most important interfaces of the spring processing view are viewresolver and view. The Viewresolver interface provides a mapping between the view name and the true view, while the view interface renders the real view to the user.

Commonly used viewresolver have the following several

Internalresourceviewresolver Resolves a logical view name to a path
Beannameviewresolver Resolves the logical view name to the Bean's Name property to find the corresponding bean according to the Name property
Resourcebundleresolver As with Beannameviewresolver, only the defined View-bean are in a properties file, and the properties file is loaded with this class
Xmlviewresolver Just like Resourcebundleresolver, the definition of View-bean in an XML file, using this class to load an XML file
Urlbasedviewresolver It simply implements the Viewresolver interface, which allows access to resources through the logical view name without any mapping.
Velocityviewresolver Support for the Velocity template engine
Freemarkerviewresolver Support for the Freemarker template engine

[Liu Yang java]_spring mvc view Parser _viewresolver_ 5th

Related Article

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.