Link to home
Start Free TrialLog in
Avatar of zollen
zollen

asked on

spring framework ModelAndView question..

Hi,

    In my controller object, it creates a ModelAndView object and invoke the following methods:

ModelAndView mv = new ModelAndView("hello");
mv.addObject(req);
mv.addObject(resp);
mv.addObject(ctx);


I would like to know how to access these objects (i.e. req, resp, ctx) in my JSP??
Thanks.
Avatar of shinobun
shinobun

You should use the ModelAndView#addObject(String, Object) [1] method instead.

mv.addObject("req", req);
mv.addObject("resp", resp);
mv.addObject("ctx", ctx);

[1] http://www.springframework.org/docs/api/org/springframework/web/servlet/ModelAndView.html#addObject(java.lang.String,%20java.lang.Object)
Avatar of zollen

ASKER

But how do I access req, resp and ctx objects in my JSP????
ASKER CERTIFIED SOLUTION
Avatar of shinobun
shinobun

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial