You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2002/05/21 08:55:01 UTC
Re: Forwarding from an action to another action and passing param
eter s... Help!
You can't add a parameter. You could only do that in javascript on the
client before you send it.
I guess you are trying to make your action generic so it can receive the
request either as the first action on submit or as a follow-on action
after another action forwards the request to it. What I do is check for
my parameter on the request, and if I don't find it, I then check for
the same value in the attributes. Or the other way around depending on
the mechanism I'm implementing.
Adam
Munchenberg, Jerome (DEH) wrote:
>Hi,
>
>Sorry...
>
>I should clarify that what I am trying to do is add a *parameter* to the
>request, not an *attribute*...
>
>Can it be done?
>
>Jerome
>
>
>
>>What's your request.getAttribute() code in Action2? The
>>Action1 looks OK.
>>
>>Munchenberg, Jerome (DEH) wrote:
>>
>>
>>
>>>Hiya,
>>>
>>>I'm using Struts 1.0.2.
>>>
>>>I have an action (Action1) which must forward to another
>>>
>>>
>>action (Action2)
>>
>>
>>>and pass it a parameter aka:
>>>
>>>*** Action1 ***
>>>
>>> // Display accession report for selected accession
>>> request.setAttribute("accession", accessionId);
>>> return mapping.findForward("accessionReport");
>>>
>>>Action2 has an associated action form with methods to
>>>
>>>
>>get/set an accession.
>>
>>
>>>For some reason, "accession" does not seem to get passed to
>>>
>>>
>>(and set in)
>>
>>
>>>Action2.
>>>
>>>Am I doing the right thing here? If so, why don't it work!
>>>
>>>
>>If not, what else
>>
>>
>>>can I do?
>>>
>>>Help!
>>>
>>>Jerome
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
>>>
>><ma...@jakarta.apache.org>
>>
>>
>>>For additional commands, e-mail:
>>>
>>>
>><ma...@jakarta.apache.org>
>>
>>
>>>
>>>
>>>
>>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>