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