A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
is it necessary that method of Controller Class of Spring should return a Model and View Object?
Joined: Jul 07, 2012
Oct 05, 2012 14:03:17
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
Joined: Jan 19, 2011
Oct 06, 2012 03:03:18
hi Monica. Shiralkar,
No its not necessary that every time you should return ModelAndView object. you can also return Map or List.
(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.
I agree. Here's the link:
subject: is it necessary that method of Controller Class of Spring should return a Model and View Object?
One view/controller, pluggable models
different approaches to MVC
Decoupling the GUI
Spring MVC 3.0 Controller Unit testing
Spring MVC -- where does the model code go?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015