I'm writing a web app similar to the petclinic. As with petclinic, I can find, add and edit users. Additionally I can find, add and edit pets as well (same classes/jsp's as the user flow).
Now if I add or edit a user, I would assign an existing pet (only one) to the user, but differential to the petclinic, I don't want to add (and therefore create) a new pet, instead I want to add an existing one, i.e. I want to jump to the findPets page, find a pet and assign this pet (with a button on the pet detail page) to the user. After clicking on this button, the add or edit user page should appear again (and the already entered user information should still be there).
I cannot use an AbstractWizardFormController because the flow could change, i.e. on the findPets page it should be possible to find an existing one or to create a new one, both going afterwards to the pet detail page with the "assign button" on it.
I think I have to save the user command object as well as the pet command object into the session (instead of the request), so that they could being reused after returning from the pet detail page to the user add or edit page. So I've tried to use the sessionForm property as well as the setSessionForm(true) method, but it doesn't work. I'm not sure on which subclasses of the SimpleFormController I must set this property exactly.
Could anyone help me please?