You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Erickson <de...@cmcflex.com> on 2003/09/18 23:10:47 UTC
Passing information from action to action
Hi I am chaining to actions together, I have one that displays a form and if
you submit it calls the modify action then forwards straight back to the
action that displays the form. Is there anyway for me to pass variables
inbetween the modify->display action other than using the session? I tried
using the request but for some reason even though I set an item in the
request in modify it doesn't change the value that the display action sees.
Thanks!
David
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Passing information from action to action
Posted by David Erickson <de...@cmcflex.com>.
To further clarify what seems to be my problem.
Display action sets begRecord and endRecord attributes in the request ->
JSP renders a form -> submitted form goes to Modify Action -> modify action
tries to put something in begRecord and endRecord, appears to be ok ->
forwards to display action, display action sees the same values in its
request object that were originally set by itself earlier. Talk about
weird?!
-David
----- Original Message -----
From: "David Erickson" <de...@cmcflex.com>
To: "Struts Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, September 18, 2003 3:10 PM
Subject: Passing information from action to action
> Hi I am chaining to actions together, I have one that displays a form and
if
> you submit it calls the modify action then forwards straight back to the
> action that displays the form. Is there anyway for me to pass variables
> inbetween the modify->display action other than using the session? I
tried
> using the request but for some reason even though I set an item in the
> request in modify it doesn't change the value that the display action
sees.
> Thanks!
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Passing information from action to action
Posted by Andrew Hill <an...@gridnode.com>.
Nothing a few 'hail McClanahan's won't absolve you from...
-----Original Message-----
From: David Erickson [mailto:derickson@cmcflex.com]
Sent: Friday, 19 September 2003 05:37
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: Re: Passing information from action to action
Excellent.. that worked great. Is there any evilness to having redirect
false if the related actions do not have forms?
thanks
-David
----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts" <st...@jakarta.apache.org>
Sent: Thursday, September 18, 2003 3:31 PM
Subject: RE: Passing information from action to action
> In the struts config for the forward you can write <forward name="bob"
> redirect="true" path="/scooby.do"/>
>
> Or if you want to do it in code in your action you can create a new
forward
> instance to return (which is also useful if you want to decorate the url
> with extra parameters):
>
> ActionForward f = mapping.findForward("bob");
> f = new ActionForward( f.getPath(), true);
> return f;
>
> -----Original Message-----
> From: David Erickson [mailto:derickson@cmcflex.com]
> Sent: Friday, 19 September 2003 05:28
> To: Struts Users Mailing List; andrew.david.hill@gridnode.com
> Subject: Re: Passing information from action to action
>
>
> Eep I believe I may be performing a cardinal sin. Currently its whatever
> the default is set to.. how would I change it to a redirecting forward?
> I tried using forward = mapping.findForward("success");
> then doing forward.setRedirect(true); and it gave me some kind of config
> frozen error..
> help! =)
> -David
>
> ----- Original Message -----
> From: "Andrew Hill" <an...@gridnode.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, September 18, 2003 3:22 PM
> Subject: RE: Passing information from action to action
>
>
> > Is that an african or european swallow?
> >
> > umm... I mean is that a redirecting or non-redirecting forward from the
> > modify to the display action?
> > If redirecting then of course request attributes are lost. If
> > non-redirecting, then you are performing the evil sin of action chaining
> and
> > the gods of struts shall surely punish you by running your request
through
> > the request processor a second time - one of the the many results of
which
> > is that your actionform is reset and repopulated from the submit data.
> >
> > -----Original Message-----
> > From: David Erickson [mailto:derickson@cmcflex.com]
> > Sent: Friday, 19 September 2003 05:11
> > To: Struts Mailing List
> > Subject: Passing information from action to action
> >
> >
> > Hi I am chaining to actions together, I have one that displays a form
and
> if
> > you submit it calls the modify action then forwards straight back to the
> > action that displays the form. Is there anyway for me to pass variables
> > inbetween the modify->display action other than using the session? I
> tried
> > using the request but for some reason even though I set an item in the
> > request in modify it doesn't change the value that the display action
> sees.
> > Thanks!
> > David
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Passing information from action to action
Posted by David Erickson <de...@cmcflex.com>.
Excellent.. that worked great. Is there any evilness to having redirect
false if the related actions do not have forms?
thanks
-David
----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts" <st...@jakarta.apache.org>
Sent: Thursday, September 18, 2003 3:31 PM
Subject: RE: Passing information from action to action
> In the struts config for the forward you can write <forward name="bob"
> redirect="true" path="/scooby.do"/>
>
> Or if you want to do it in code in your action you can create a new
forward
> instance to return (which is also useful if you want to decorate the url
> with extra parameters):
>
> ActionForward f = mapping.findForward("bob");
> f = new ActionForward( f.getPath(), true);
> return f;
>
> -----Original Message-----
> From: David Erickson [mailto:derickson@cmcflex.com]
> Sent: Friday, 19 September 2003 05:28
> To: Struts Users Mailing List; andrew.david.hill@gridnode.com
> Subject: Re: Passing information from action to action
>
>
> Eep I believe I may be performing a cardinal sin. Currently its whatever
> the default is set to.. how would I change it to a redirecting forward?
> I tried using forward = mapping.findForward("success");
> then doing forward.setRedirect(true); and it gave me some kind of config
> frozen error..
> help! =)
> -David
>
> ----- Original Message -----
> From: "Andrew Hill" <an...@gridnode.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, September 18, 2003 3:22 PM
> Subject: RE: Passing information from action to action
>
>
> > Is that an african or european swallow?
> >
> > umm... I mean is that a redirecting or non-redirecting forward from the
> > modify to the display action?
> > If redirecting then of course request attributes are lost. If
> > non-redirecting, then you are performing the evil sin of action chaining
> and
> > the gods of struts shall surely punish you by running your request
through
> > the request processor a second time - one of the the many results of
which
> > is that your actionform is reset and repopulated from the submit data.
> >
> > -----Original Message-----
> > From: David Erickson [mailto:derickson@cmcflex.com]
> > Sent: Friday, 19 September 2003 05:11
> > To: Struts Mailing List
> > Subject: Passing information from action to action
> >
> >
> > Hi I am chaining to actions together, I have one that displays a form
and
> if
> > you submit it calls the modify action then forwards straight back to the
> > action that displays the form. Is there anyway for me to pass variables
> > inbetween the modify->display action other than using the session? I
> tried
> > using the request but for some reason even though I set an item in the
> > request in modify it doesn't change the value that the display action
> sees.
> > Thanks!
> > David
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Passing information from action to action
Posted by Andrew Hill <an...@gridnode.com>.
In the struts config for the forward you can write <forward name="bob"
redirect="true" path="/scooby.do"/>
Or if you want to do it in code in your action you can create a new forward
instance to return (which is also useful if you want to decorate the url
with extra parameters):
ActionForward f = mapping.findForward("bob");
f = new ActionForward( f.getPath(), true);
return f;
-----Original Message-----
From: David Erickson [mailto:derickson@cmcflex.com]
Sent: Friday, 19 September 2003 05:28
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: Re: Passing information from action to action
Eep I believe I may be performing a cardinal sin. Currently its whatever
the default is set to.. how would I change it to a redirecting forward?
I tried using forward = mapping.findForward("success");
then doing forward.setRedirect(true); and it gave me some kind of config
frozen error..
help! =)
-David
----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, September 18, 2003 3:22 PM
Subject: RE: Passing information from action to action
> Is that an african or european swallow?
>
> umm... I mean is that a redirecting or non-redirecting forward from the
> modify to the display action?
> If redirecting then of course request attributes are lost. If
> non-redirecting, then you are performing the evil sin of action chaining
and
> the gods of struts shall surely punish you by running your request through
> the request processor a second time - one of the the many results of which
> is that your actionform is reset and repopulated from the submit data.
>
> -----Original Message-----
> From: David Erickson [mailto:derickson@cmcflex.com]
> Sent: Friday, 19 September 2003 05:11
> To: Struts Mailing List
> Subject: Passing information from action to action
>
>
> Hi I am chaining to actions together, I have one that displays a form and
if
> you submit it calls the modify action then forwards straight back to the
> action that displays the form. Is there anyway for me to pass variables
> inbetween the modify->display action other than using the session? I
tried
> using the request but for some reason even though I set an item in the
> request in modify it doesn't change the value that the display action
sees.
> Thanks!
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Passing information from action to action
Posted by David Erickson <de...@cmcflex.com>.
Eep I believe I may be performing a cardinal sin. Currently its whatever
the default is set to.. how would I change it to a redirecting forward?
I tried using forward = mapping.findForward("success");
then doing forward.setRedirect(true); and it gave me some kind of config
frozen error..
help! =)
-David
----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, September 18, 2003 3:22 PM
Subject: RE: Passing information from action to action
> Is that an african or european swallow?
>
> umm... I mean is that a redirecting or non-redirecting forward from the
> modify to the display action?
> If redirecting then of course request attributes are lost. If
> non-redirecting, then you are performing the evil sin of action chaining
and
> the gods of struts shall surely punish you by running your request through
> the request processor a second time - one of the the many results of which
> is that your actionform is reset and repopulated from the submit data.
>
> -----Original Message-----
> From: David Erickson [mailto:derickson@cmcflex.com]
> Sent: Friday, 19 September 2003 05:11
> To: Struts Mailing List
> Subject: Passing information from action to action
>
>
> Hi I am chaining to actions together, I have one that displays a form and
if
> you submit it calls the modify action then forwards straight back to the
> action that displays the form. Is there anyway for me to pass variables
> inbetween the modify->display action other than using the session? I
tried
> using the request but for some reason even though I set an item in the
> request in modify it doesn't change the value that the display action
sees.
> Thanks!
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Passing information from action to action
Posted by Andrew Hill <an...@gridnode.com>.
Is that an african or european swallow?
umm... I mean is that a redirecting or non-redirecting forward from the
modify to the display action?
If redirecting then of course request attributes are lost. If
non-redirecting, then you are performing the evil sin of action chaining and
the gods of struts shall surely punish you by running your request through
the request processor a second time - one of the the many results of which
is that your actionform is reset and repopulated from the submit data.
-----Original Message-----
From: David Erickson [mailto:derickson@cmcflex.com]
Sent: Friday, 19 September 2003 05:11
To: Struts Mailing List
Subject: Passing information from action to action
Hi I am chaining to actions together, I have one that displays a form and if
you submit it calls the modify action then forwards straight back to the
action that displays the form. Is there anyway for me to pass variables
inbetween the modify->display action other than using the session? I tried
using the request but for some reason even though I set an item in the
request in modify it doesn't change the value that the display action sees.
Thanks!
David
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org