ModelMap
has a similar purpose, with the ability to pass a collection of values. It then treats those values as if they were within a Map. We should note that in Model (ModelMap
) we can only store data. We put data in and return a view name.ModelAndView
, we return the object itself. We set all the required information, like the data and the view name, in the object we're returning.