Accessing another action's form from within an action?

2002-10-04 Thread Davide Bruzzone

Hello all...

I'd like to know if this is possible, and if so how:

- A user submits a form
- The request hits the appropriate action (ActionA), and when the action
gets to return (mapping.findForward(forwardName));, the forwardName
forward maps to another action, say:

...
forward name=forwardName redirect=false
path=/ActionB.do?action=view/
...

- ActionB is reached
- What I'd like to be able to do is access the form object that was
available to the first action (FormA) in ActionB (since it is this form
object that has the values that I need to do some work in ActionB). Within
struts-config.xml, ActionA is associated with FormA and ActionB is
associated with FormB.

I could put the information that I need into the session, but I want to find
out if there's a built-in/more elegant way to do this.

Any information would be greatly appreciated...

Dave Bruzzone

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Accessing another action's form from within an action?

2002-10-04 Thread Dave Derry

You could attach the form to the request in Action A and retrieve in in
Action B.

Action A:  request.setAttribute( ActionAForm, theFormForActionA );

Action B: ActionAForm theForm = (ActionAForm)request.getAttribute(
ActionAForm );

Would that work for you?

Dave Derry


- Original Message -
From: Davide Bruzzone [EMAIL PROTECTED]


 Hello all...

 I'd like to know if this is possible, and if so how:

 - A user submits a form
 - The request hits the appropriate action (ActionA), and when the action
 gets to return (mapping.findForward(forwardName));, the forwardName
 forward maps to another action, say:

 ...
 forward name=forwardName redirect=false
 path=/ActionB.do?action=view/
 ...

 - ActionB is reached
 - What I'd like to be able to do is access the form object that was
 available to the first action (FormA) in ActionB (since it is this form
 object that has the values that I need to do some work in ActionB). Within
 struts-config.xml, ActionA is associated with FormA and ActionB is
 associated with FormB.

 I could put the information that I need into the session, but I want to
find
 out if there's a built-in/more elegant way to do this.

 Any information would be greatly appreciated...

 Dave Bruzzone



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Accessing another action's form from within an action?

2002-10-04 Thread Davide Bruzzone

Dave,

Thanks for the suggestion...

Yes, the request will work... Its shorter-lived than the session so I think
that it is a better alternative.

Cheers...

Dave

-Original Message-
From: Dave Derry [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 9:04 AM
To: Struts Users Mailing List
Subject: Re: Accessing another action's form from within an action?


You could attach the form to the request in Action A and retrieve in in
Action B.

Action A:  request.setAttribute( ActionAForm, theFormForActionA );

Action B: ActionAForm theForm = (ActionAForm)request.getAttribute(
ActionAForm );

Would that work for you?

Dave Derry


- Original Message -
From: Davide Bruzzone [EMAIL PROTECTED]


 Hello all...

 I'd like to know if this is possible, and if so how:

 - A user submits a form
 - The request hits the appropriate action (ActionA), and when the action
 gets to return (mapping.findForward(forwardName));, the forwardName
 forward maps to another action, say:

 ...
 forward name=forwardName redirect=false
 path=/ActionB.do?action=view/
 ...

 - ActionB is reached
 - What I'd like to be able to do is access the form object that was
 available to the first action (FormA) in ActionB (since it is this form
 object that has the values that I need to do some work in ActionB). Within
 struts-config.xml, ActionA is associated with FormA and ActionB is
 associated with FormB.

 I could put the information that I need into the session, but I want to
find
 out if there's a built-in/more elegant way to do this.

 Any information would be greatly appreciated...

 Dave Bruzzone



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]