Announcement Announcement Module
Collapse
No announcement yet.
Passing the model from one controller to another Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing the model from one controller to another

    I don't understand why this is not working. Can I have a view controller creating a model like this:

    Code:
    model.put("data", someObject);
    return new ModelAndView("aFormView", model);
    to be retrieved by a second controller using referenceData like this:

    Code:
    SomeObject someObject = (SomeObject) request.getAttribute("data");
    I have the feeling I'm missing a basic thing here .... Sorry.

  • #2
    try
    Code:
    return new ModelAndView("forward:aFormView", model);
    HTH

    Comment


    • #3
      How do you retrieve the model in the second controller?

      Comment


      • #4
        HI all,

        I too have the same problem here.
        i set using:
        return new ModelAndView("blah","model",object);

        "model" is visible in "blah" but it is not accessible in other pages.
        Is there any solution for this???

        Regards,
        Kamal

        Comment

        Working...
        X