Announcement Announcement Module
Collapse
No announcement yet.
about referenceData Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • about referenceData

    hi,

    New to Spring. Trying to use the SimpleFormController for my forms.
    for testing, I have two forms, A and B, and two corresponding controllers, Ac, and Bc. User fill out some info on A, hit submit, and goes to B.

    In Ac's onSubmit, I have this:

    return new ModelAndView(getSuccessView(), "model", myModel);

    When I do that, the referenceData() method in Bc was never called. So I changed it to:

    return new ModelAndView(new RedirectView(getSuccessView() + ".htm"), "model", myModel);

    Now referenceData() gets called, but the model object was not passed.

    How do I ensure both?

    Thanks,

    yan

  • #2
    Re: about referenceData

    Try either:
    Code:
    return new ModelAndView(new RedirectView(getSuccessView() + ".htm"), myModel);
    or:
    Code:
    return new ModelAndView("forward:" + getSuccessView() + ".htm"), myModel);

    Comment


    • #3
      Yup, tried it, but the model now is only a map of strings. it can't be a map of objects, otherwise the objects are serialized.

      Comment


      • #4
        Did you try the second one, which should be a server side forward with the original model?

        Comment

        Working...
        X