struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhinav Bhatnagar" <Abhinav_Bhatna...@infosys.com>
Subject RE: Adding parameter to local forwards
Date Mon, 13 Jun 2005 03:50:57 GMT

Thanks! That was new information for me.

For my application, the parameter value I want to pass is fixed, so I am
doing it in the struts-config path itself, something like this :

<action path="/SubmitDrawingUpload" type="SubmitDrawingUploadAction"
name="DrawingUploadForm">
<forward name="showParentForm" path="/DrawingUpdate.do?drawing_id=24"/>
</action>

It works but please advise if it's proper.

Regards,
Abhinav

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Laurie Harper
Sent: Saturday, June 11, 2005 12:25 AM
To: user@struts.apache.org
Subject: Re: Adding parameter to local forwards

If a redirect rather than a forward is acceptable, you can also look at
ActionRedirect (new in 1.2.7).

	ActionForward fwd = mapping.findForward(...);
         ActionRedirect ar = new ActionRedirect(fwd);
         ar.addParameter("name", f.getString("name"));
	return ar;

L.

Michael Jouravlev wrote:

> Something like this:
>
> ActionForward af = mapping.findForward("showParentForm");
> return new ActionForward(
>   actionForward.getName(),
>   actionForward.getPath() + "?drawing_id=24",
>   actionForward.getRedirect()
> );
>
> You must create a new instance of ActionForward, you cannot change
> existing one, since it is frozen.
>
> Michael.
>
> On 6/10/05, Yuniar Setiawan <yuniarsetiawan@gmail.com> wrote:
>
>>Hi all, I have a configuration like this one below:
>> <action path="/SubmitDrawingUpload" type="SubmitDrawingUploadAction"
>>name="DrawingUploadForm">
>><forward name="showParentForm" path="/DrawingUpdate.do"/>
>></action>
>> now inside the SubmitDrawingUploadAction class usually i just need
the
>>following statement to forward to DrawingUpdate.do :
>> return mapping.findForwards("showParentForm");
>> the question is, what if I want to add extra parameter?? so it would
be
>>forwarded into DrawingUpdate.do?drawing_id=24
>>how can I add that 'drawing_id' parameter from inside
>>SubmitDrawingUploadAction class
>
> ?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


******************* CAUTION - Disclaimer ****************** This e-mail contains PRIVILEGED
AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not
the intended recipient, please notify the sender by e-mail and delete the original message.
Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other
person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage you may
sustain as a result of any virus in this e-mail. You should carry out your own virus checks
before opening the e-mail or attachment. Infosys reserves the right to monitor and review
the content of all messages sent to or from this e-mail address. Messages sent to or from
this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message