Results 1 to 2 of 2

Thread: Passing a model/cmd from Controller to SimpleFormController

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    San Francisco, CA
    Posts
    66

    Default Passing a model/cmd from Controller to SimpleFormController

    I have a regular Controller (let's called it A) which does some fancy processing, and builds a non-trivial command object as its result. It then redirects to another Controller (and this form is B), this time, it's a SimpleFormController.

    I'd like to use the command built by A as the form backing object in B.

    I've been placing the object in the HttpSession, and pulling it out in B's formBackingObject(). Is there a way to pass it as part of the model from A and get to it in B? Placing it in the session seems like a bad idea.

    This seems like something that shouldn't be too hard to do. I've stepped through the code and it all makes sense, I am surprised not to find some flag or setting which just does what I need. Maybe I'm missing something?

    Thanks!
    Christian

  2. #2
    Join Date
    Aug 2004
    Location
    Auburn, AL, USA.
    Posts
    106

    Default

    If you are really redirecting then I don't see any way around putting the object into the session (you can always take it out); alternatively you could override the formBackingObject() on controller B and use the request.get/setAttribute to store it in the current request if you use RequestDispatcher.forward.

Similar Threads

  1. Replies: 15
    Last Post: Aug 3rd, 2005, 05:41 PM
  2. Passing data from the web to the controller
    By maveganzones in forum Web
    Replies: 3
    Last Post: Jun 29th, 2005, 04:06 AM
  3. Replies: 5
    Last Post: Mar 28th, 2005, 08:29 AM
  4. Replies: 3
    Last Post: Mar 8th, 2005, 11:04 AM
  5. Replies: 8
    Last Post: Jan 17th, 2005, 10:14 AM

Posting Permissions

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