1

I am using ModelAndView in the Spring and Spring Boot projects to pass the parameters and set the view from the controller. I have discovered that I can also do that by using Model and ModelMap. ModelAndView is different from these because it returns the parameters and the view object in a single return value. However I could not find much difference between these two.

I know that Model is interface but ModelMap is a class. Additionally Model is newer and it can be used to merge attributes by taking a map as input.

Is there any other difference or advantage of one on the other?

Thanks.

ahmetcetin
  • 2,621
  • 1
  • 22
  • 38

0 Answers0