The usage of ModelAndView ModelMap and Model to store values
1. Usage of ModelAndView
It cannot be placed directly in the parameters of the method, but needs to be created by new in the method.
The object ModelAndView can be created directly in the method mv = new ModelAndView () ;
Put the value that the page needs to get into the mv through the addObject method .
Direct return mv points to that page,
Find the corresponding page by the name of the annotation on the class name / the name of the annotation on the method.
It finds the page by splicing the annotation name on the class and the annotation name on the method to find the page
2.ModelMap is exactly the same as the usage of model. Whoever assigns the value last will take it first.
Store the value in the addAttribute method
Model and ModelMap find the page through the return value. model.addAttribute("user",User);
You can get the user's object through ${user} in the foreground