You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by prasad pondugula <po...@genco.com> on 2006/07/14 22:39:57 UTC
ActionMapping forward.findForward(str) with dynamic parameters
Hello all,
In an action class, how do we pass some dynamic parameter/values to an
action forward. So that we do not need to hard code any values in
struts-config.xml's (<forward name="fwdDetail" path="tilesDefDetail"
redirect="true" />).
Example:
TestAction.java:
String key = "task";
String value = "displayAccountDetails"; // this value changes
dynamically based on some logic.
return mapping.findForward("fwdDetail");
Please advice as soon as possible.
Regards,
Prasad Pondugula
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure of
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ActionMapping forward.findForward(str) with dynamic parameters
Posted by Hubert Rabago <hr...@gmail.com>.
Do you mean something like ActionRedirect?
String key = "task";
String value = "displayAccountDetails"; // this value changes
return new ActionRedirect(mapping.findForward("fwdDetail"))
.addParameter(key, value);
It still won't allow you to redirect to a tile, though.
Hubert
On 7/14/06, prasad pondugula <po...@genco.com> wrote:
>
> Hello all,
>
> In an action class, how do we pass some dynamic parameter/values to an
> action forward. So that we do not need to hard code any values in
> struts-config.xml's (<forward name="fwdDetail" path="tilesDefDetail"
> redirect="true" />).
>
> Example:
>
> TestAction.java:
>
> String key = "task";
> String value = "displayAccountDetails"; // this value changes
> dynamically based on some logic.
>
> return mapping.findForward("fwdDetail");
>
> Please advice as soon as possible.
>
>
> Regards,
> Prasad Pondugula
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org