Webflow is not an easy thing to handle with spring, there is an open source project which I think does the job well, it is the springwebflow but I did not try to use it.
From my own experience, and I used only the AstractWizardFormController, if you want to leave the wizard and forward to another controller, you can have a hidden field named _finish that you enabled by javascript, and a field named nextController which will tell which controller you want to forward to. After posting, it will execute the processFinish method of your wizard. With correct parameters in the request, your can forward to the next controller, after persisting your data.
To come back to your Customer Workflow, you will have to have parameters in your request to tell which page you want to come back to on your controller. This parameter will be decoded in the method getInitalPage that you will override to display the correct page.
Exemple :
to leave your customer wizard to go to your address wizard :
Code:
processFinish(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) {
myManager.update(command);
String nextController = request.getParameter("myNextController");
if (nextController!=null && "address".equals(nextController)) {
return new ModelAndView(new RedirectView("myAddressController.html");
}
return new ModelAndView ("myFinishViewCustomer.html");
}
to come back to the 2nd page of your abstract wizard controller Customer, after having inputed the address, you could do something like that after forwarding to MyCustomerWizardController.html?address=complete.
Code:
protected getInitialPage(HttpServletRequest request) {
String address = request.getParameter("address");
if (address!=null && "complete".equals(address) {
return 2;
}
return super.getInitialPage(request);
}
Hope this will help
Olivier