Re: [s2] Dynamically Parameterize Redirect Result
On 11/10/06 6:46 PM, "Don Brown" <[EMAIL PROTECTED]> wrote: > I believe that any unknown result parameters are automatically used as > request parameters for the redirect. Then, use an ognl expression for > your param value and provide a getter on your action for the value. Hi Don, Do you have an example of using OGNL to provide the param to the redirect? Thanks, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Dynamically Parameterize Redirect Result
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, Mark Menard wrote: > Is there a way to dynamically parameterize a redirect result based on an > http request parameter that you have used in the action your are redirecting > from? This isn't exactly struts-2 specific, if I'm reading this correctly. > Is there a way to get a parameter that was passed to createPartyRoleType > into the redirect on success? One way to do it is like this, at the end of your action: ActionForward next = mapping.findForward("redirect-action"); return new ActionForward(next.getPath() + "?id=" + id, next.getRedirect()); There is also ActionRedirect, which essentially wraps an existing ActionForward: ActionRedirect next = new ActionRedirect(mapping.findForward("...")); next.addParameter("id", id); return next; I personally think that ActionRedirect isn't good enough, and needs a lot of improvement. I write my own class and submitted it as an attachment to https://issues.apache.org/struts/browse/STR-2538, but nobody seemed interested. Everyone is free to use this class if they'd like. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFVRAj9CaO5/Lv0PARArG7AKCMT5MGdFgUqR6WUWD2ptIxTI5odgCeJl5d VfPtoSuUAzK49IUsAbF4F5k= =Xoua -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Dynamically Parameterize Redirect Result
I believe that any unknown result parameters are automatically used as request parameters for the redirect. Then, use an ognl expression for your param value and provide a getter on your action for the value. Don On 11/10/06, Mark Menard <[EMAIL PROTECTED]> wrote: Is there a way to dynamically parameterize a redirect result based on an http request parameter that you have used in the action your are redirecting from? In other words I'm doing some work in an action that is based on an ID that was passed into it from the HTML form. I need to do some work, then I need to go back to a list that is parameterized on that ID. I have a result: /ManagePartyRoleTypes.jsp managePartyRoleTypes Is there a way to get a parameter that was passed to createPartyRoleType into the redirect on success? Thanks, Mark - 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]
[s2] Dynamically Parameterize Redirect Result
Is there a way to dynamically parameterize a redirect result based on an http request parameter that you have used in the action your are redirecting from? In other words I'm doing some work in an action that is based on an ID that was passed into it from the HTML form. I need to do some work, then I need to go back to a list that is parameterized on that ID. I have a result: /ManagePartyRoleTypes.jsp managePartyRoleTypes Is there a way to get a parameter that was passed to createPartyRoleType into the redirect on success? Thanks, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]