Does it have to be a parameter? You should be able to do
request.setAttribute("id","1"), which you can retrieve in Action 2 with
request.getAttribute("id").
(*Chris*)
On 9/22/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
The ActionForward instances returned by findForward() are unalterable,
that's what the exception is telling you. What you can do is:
ActionForward fwd = new ActionForward(mapping.findForward("gf_action2"));
That gives you an exact copy of the forward, and you can then alter it as
required.
Frank
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
(2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!
On Fri, September 22, 2006 1:02 pm, Tony Smith wrote:
> Hi, thank you very much.
>
> But I got the "java.lang.IllegalStateException:
> Configuration is frozen"
>
> exception.
>
> Could you please help me?
>
> Thanks,
> qq
>
>
> --- "Givler, Eric" <[EMAIL PROTECTED]> wrote:
>
>> Can't you do something like this:
>>
>> fwd = mapping.findForward( "gf_action2" );
>> fwd.setPath( fwd.getPath() + "?id=100");
>> return fwd;
>>
>> gf_action2 would be a global-forward to action2.
>>
>> -----Original Message-----
>> From: Tony Smith [mailto:[EMAIL PROTECTED]
>> Sent: Friday, September 22, 2006 10:46 AM
>> To: Struts Users Mailing List
>> Subject: pass parameter between actions
>>
>>
>> Hi,
>>
>> I have to actions, action1 and action2,
>>
>> <action
>> path="/action1"
>> type="JavaCodeAction1"
>> name="action1Form"
>> scope="request"
>> validate="true">
>> <forward name="success" path="action1"/>
>> <forward name="default" path="/home.do"/>
>> </action>
>>
>>
>> <action
>> path="/action2"
>> type="JavaCodeAction2"
>> name="action2Form"
>> scope="request"
>> validate="true">
>> <forward name="success" path="something"/>
>> <forward name="default" path="/home.do"/>
>> </action>
>>
>> Inside action1,
>>
>> protected ActionForward execute(
>> ActionMapping mapping,
>> ActionForm form,
>> HttpServletRequest request,
>> HttpServletResponse respose)
>> throws Exception {
>>
>> String id = 100; //or other number
>> ....
>>
>> }
>>
>> Once action1 is successful, I would like to call
>> action2 with the link action2.do?id=100. However, I
>> do
>> not know how to pass the parameter "id" to action2.
>>
>> Could anyone help?
>>
>> Thanks,
>>
>> qq
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam
>> protection around
>> http://mail.yahoo.com
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]