You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/11/21 07:49:14 UTC
why/when to use redirect
I am not really clear when to use redirect=true.
I am chaining actions. As I was doing this I had to use redirect=true to get
the values that were set in one action to another. But the request
attributes set in that action were lost when redirect is set to true. why is
that? is there any way, I can use redirect=true and also get the request
attributes???
also, not really sure when to use the contextRelative=true/false/yes/no??
Thanks.
_________________________________________________________________
Share your latest news with your friends with the Windows Live Spaces
friends module.
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: why/when to use redirect
Posted by Mississippi John Hurt <jo...@gmail.com>.
How could I forward via redirect option but have struts pass any request
attributes or parameters to the new redirect url? I think its only possible
to pass the request parameters and not the attributes right? How can I do
that? Thanks.
On 11/23/06, Adam Hardy <ah...@cyberspaceroad.com> wrote:
>
> You can also manipulate your forward to put the parameters (preferably
> just an
> ID, not a whole set of properties) onto the querystring, so that they
> reappear
> in the request parameters and your form bean. It's the Post-Redirect-Get
> pattern.
>
> Nuwan Chandrasoma on 21/11/06 10:15, wrote:
> > if you use redirect=true , it would create a new request.. so what ever
> > u had on the reqest will be lost. i think u have your action in request
> > socope, you can change them to session scope and make sure you removed
> > the Form and other attribute you put on the session after the action is
> > finished.
> >
> > ----- Original Message ----- From: "fea jabi" <zy...@hotmail.com>
> > To: <us...@struts.apache.org>
> > Sent: Tuesday, November 21, 2006 6:49 AM
> > Subject: why/when to use redirect
> >> I am not really clear when to use redirect=true.
> >>
> >> I am chaining actions. As I was doing this I had to use redirect=true
> >> to get the values that were set in one action to another. But the
> >> request attributes set in that action were lost when redirect is set
> >> to true. why is that? is there any way, I can use redirect=true and
> >> also get the request attributes???
> >>
> >> also, not really sure when to use the
> contextRelative=true/false/yes/no??
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: why/when to use redirect
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
You can also manipulate your forward to put the parameters (preferably just an
ID, not a whole set of properties) onto the querystring, so that they reappear
in the request parameters and your form bean. It's the Post-Redirect-Get pattern.
Nuwan Chandrasoma on 21/11/06 10:15, wrote:
> if you use redirect=true , it would create a new request.. so what ever
> u had on the reqest will be lost. i think u have your action in request
> socope, you can change them to session scope and make sure you removed
> the Form and other attribute you put on the session after the action is
> finished.
>
> ----- Original Message ----- From: "fea jabi" <zy...@hotmail.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, November 21, 2006 6:49 AM
> Subject: why/when to use redirect
>> I am not really clear when to use redirect=true.
>>
>> I am chaining actions. As I was doing this I had to use redirect=true
>> to get the values that were set in one action to another. But the
>> request attributes set in that action were lost when redirect is set
>> to true. why is that? is there any way, I can use redirect=true and
>> also get the request attributes???
>>
>> also, not really sure when to use the contextRelative=true/false/yes/no??
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: why/when to use redirect
Posted by Nuwan Chandrasoma <my...@gmail.com>.
hi,
if you use redirect=true , it would create a new request.. so what ever u
had on the reqest will be lost. i think u have your action in request
socope, you can change them to session scope and make sure you removed the
Form and other attribute you put on the session after the action is
finished.
Regards,
Nuwan
----- Original Message -----
From: "fea jabi" <zy...@hotmail.com>
To: <us...@struts.apache.org>
Sent: Tuesday, November 21, 2006 6:49 AM
Subject: why/when to use redirect
>I am not really clear when to use redirect=true.
>
> I am chaining actions. As I was doing this I had to use redirect=true to
> get the values that were set in one action to another. But the request
> attributes set in that action were lost when redirect is set to true. why
> is that? is there any way, I can use redirect=true and also get the
> request attributes???
>
> also, not really sure when to use the contextRelative=true/false/yes/no??
>
>
> Thanks.
>
> _________________________________________________________________
> Share your latest news with your friends with the Windows Live Spaces
> friends module.
> http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org