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