Results 1 to 2 of 2

Thread: Scope of the command object if I jump between JSP's

  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Default Scope of the command object if I jump between JSP's

    Hi!

    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?

    Regards,
    bedag

  2. #2
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    This kind of stuff can be done with the Spring web flow controller (http://www.ervacon.com/products/springwebflow). You could model your application with a user-flow and a pet-flow and have the user-flow call the pet-flow as a sub flow to find a pet to assign. When the pet-flow returns you map the selected pet into the user-flow model.

    Read http://www.ervacon.com/products/springwebflow/article for details on how to use this controller.

    Erwin

Similar Threads

  1. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  2. Replies: 2
    Last Post: Oct 10th, 2005, 02:10 AM
  3. Replies: 4
    Last Post: Aug 26th, 2005, 01:35 PM
  4. Request vs. Flow Scope: documentation?
    By Tom Hicks in forum Web Flow
    Replies: 5
    Last Post: Aug 2nd, 2005, 03:30 PM
  5. Enabling Spring in ugly JSPs
    By jlindwall in forum Web
    Replies: 2
    Last Post: May 31st, 2005, 12:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •