Configure the view resolver inside the Springmvc.xml
1 <!--Configure the View resolver: How to resolve the handler method return value to the actual physical view -2 <Beanclass= "Org.springframework.web.servlet.view.InternalResourceViewResolver">3 < Propertyname= "prefix"value= "/web-inf/views/"></ Property>4 < Propertyname= "suffix"value= ". jsp"></ Property>5 </Bean>
The process by which Spring MVC transforms a logical view into a physical view
? When the request processing method finishes executing, a Modelandview object is returned. For those processing methods that return types such as String,view or Modemap, Spring MVC also assembles them internally into a Modelandview object that contains a view of the logical names and model objects
? Spring MVC uses the View parser (Viewresolver) to get the final view object (view), which can be either a JSP or a view of various representations, such as Excel, Jfreechart, etc.
? The processor is not concerned about what view objects are ultimately being taken to render the model data, and the processor focuses on the work of the production model data to fully decouple the MVC
Second, view parser
? 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 corresponds 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:
Third, view
? The purpose of the view is to render the model data and present the data in the model to the customer in some form.
? In order to decouple the view model and the implementation technology, Spring defines a highly abstract view in the Org.springframework.web.servlet package.
Interface:
? The View object is instantiated by the view resolver. Because views are stateless, they do not have thread security issues
SPRINGMVC Series (vii) View parsers and views