To your last question: It probably means you are trying to access this value 'frmPage2' somewhere else (possibly another controlelr or JSP). You renamed the model object to 'user', which is the name it's stored in the request (or session) as.
To your original issue, you say you can display the values but not access the specified controller? Let me see if I understand. You have something like the following:
page1.jsp ->Submit -> controller.onSubmit -> page2 (view w/frmPage2 as the model obj) -> page2.jsp (via view handler)
So far, so good? What controller can't you access? Is it the target controller from the page2 form?
Yep you are right. Thats the exact flow. When the page2.jsp opens up it doesn't go to a different controller . Rather it access the same controller from it was called.
Now the problem i need to load some data in Bean object through formBackingObject method. But when the page2 loads up it directly comes without moving to the BackObejct method.. And on submit of the page2 it goes to earlier controller..
I think you may have two problems. The typical pattern when returning a ModelAndView from a controller method is to resolve that view to a JSP (or some other view). Sometimes you need to do more processing or as you indicate, load a new form backing object. In that case you would put a redirect prefix on the view name. Something like:
Then your invocation path would be:
page1.jsp ->Submit -> controller.onSubmit -> redirect to controller2.formBackingObject() -> page2 (view w/frmPage2 as the model obj) -> page2.jsp (via view handler)
The other problem with page2 submit going to the same controller may have to do with the path you define for your action in the page2 form. It has to be a different path and that path has to be mapped to the new controller.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop