Announcement Announcement Module
No announcement yet.
forwarding to specified page of a wizard form Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • forwarding to specified page of a wizard form

    I'm using an AbstractWizardFormController and I've spent way too much time trying to figure out how to do this one thing:

    I have 4 pages in the wizard, and after the last one (the processFinish), I send the user to a summary page with it's own controller. This page has a "Previous" button that I would like to have go back to the last page of the wizard.

    I'm putting my command object back in the model, and also putting _page and _target3 in the model, but no matter what I try, I always get sent back to page 1. I even tried putting in the model and also in the session, but I still go back to page 1.

    I'm using a ResourceBundleViewResolver so that I can resolve to a .form or to a velocity page, which I am using for my views, so in my SummaryController, I simply return a new ModelAndView with the name mapped to my wizard controller and a Map with the attributes I'm attempting to set, such as return new ModelAndView("wizard", myMap), where wizard is setup in my resource file to use the url resolver and go to my AbstractWizardFormController.

    I should also mention that it appears from my own debug log messages that I'm getting to the getCurrentPage of my wizard controller and then it goes to page 1. I don't ever seem to get to getTargetPage, which I don't understand.

    If anyone has any ideas, I would really appreciate it. I've been stuck on this silly thing for sometime. I converted from struts a short while ago and have really enjoyed Spring, except I miss the simplicity I had with struts. Even with the source code and javadocs, I have a hard time getting my head around the exact steps my controller is going thru.

    Thanks much!


  • #2
    We seem to have this in an AbstractWizardFormController subclass. It overrides a framework method.

    I haven't looked at this for a while so if this doesn't work, let me know and I can dig and see what else contributes to choosing a default page on opening a wizard.

    protected int getInitialPage(HttpServletRequest request, Object command) {

    int targetPage = getTargetPage(request, -1);
    if (targetPage >= 0) {
    return targetPage;
    return super.getInitialPage(request, command);

    You can then put _target3 or whatever in your request to open a wizard.

    Remember the first page is _target0.