This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is it necessary that method of Controller Class of Spring should return a Model and View Object?  RSS feed

 
Monica Shiralkar
Ranch Hand
Posts: 886
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it necessary that method of Controller Class of Spring should return a Model and View Object? if no then what else can this method have insted of returning model and view object
 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Monica. Shiralkar,

No its not necessary that every time you should return ModelAndView object. you can also return Map or List.

and string(which will be accounted as view name).

Suppose you are doing Ajax call to controller and you want list of objects returned from controller than you need to put @RequestMapping annotation(if you are using Spring MVC 3.0 or above) before controller method name that you want to call.

thanks
Prashant
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!