-
Oct 18th, 2011, 01:08 AM
#1
Controller calling another Controller
Hi Experts,
Can you please help me how can a Controller call another Controller?
And passing HttpServletRequest and ModelAttribute?
Thank you very much,
-
Oct 18th, 2011, 03:17 AM
#2
I already solved this one:
In Controller A:
request.setAttribute("element", elementData);
mav.setView((new InternalResourceView("/totheNextControlllerURL.do")));
return mav;
In Controller B:
MyElement myElement = (MyElement) request.getAttribute("element");
This is done!
-
Oct 18th, 2011, 04:09 AM
#3
Hi, another way is:
ModelAndView mav = new ModelAndView("redirect:/totheNextControlllerURL.do");
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules