You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wild_oscar <mi...@almeida.at> on 2007/08/22 16:46:49 UTC
Sending value stack from Action A to Action B
Being new to Struts2, I was searching for an answer to a use case I
developed:
- Welcome page has login form (send to LoginAction)
- LoginAction reads username and password and sends to ListStuffAction
- ListStuffAction reads stuff from database and sends to Stuff page
- Stuff page lists the stuff.
In Suff page, I also have a "welcome *username*, your password is
*password*"
Now, in LoginAction the username and password are in the value Stack and I
can access them. But when I reach the Stuff page, I get an odd "Welcome, < .
Your password is <".
I'm guessing the value stack isn't sent among actions. I tried making
LoginAction's result to be of type ServletActionRedirectResult and
ActionChainResult, but both failed.
My questions are:
1) How can values in the value stack be sent among actions, so that they are
available in the final web page?
2) Isn't this a common scenario in struts2's web development?
The reason I was trying this approach is the fact that I want to use the
ListStuffAction repeatedly: when a user logs in, after a user inserts a new
record so that the list can be updated with the new value, etc.
Thank you for your answers!
--
View this message in context: http://www.nabble.com/Sending-value-stack-from-Action-A-to-Action-B-tf4312075.html#a12276288
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: RE Sending value stack from Action A to Action B
Posted by wild_oscar <mi...@almeida.at>.
I believe you are right. It does work when using Chaining. I believe I had a
bug in the final jsp page, it now works correctly. Thank you
Laszlo Borsos wrote:
>
> I haven't tried it yet, but the Chaining Interceptor is also meant for
> this purpose.
>
>
> MLENEVEUT@abusinessware.com wrote:
>>> 1) How can values in the value stack be sent among actions, so that they
>> are
>>> available in the final web page?
>>
>> Put your values in HttpSession
>>
>>
>>
>>
>>
>> wild_oscar <mi...@almeida.at>
>> 22/08/2007 16:48
>> Veuillez répondre à
>> "Struts Users Mailing List" <us...@struts.apache.org>
>>
>>
>> A
>> user@struts.apache.org
>> cc
>>
>> Objet
>> Sending value stack from Action A to Action B
>>
>>
>>
>>
>>
>>
>>
>> Being new to Struts2, I was searching for an answer to a use case I
>> developed:
>>
>> - Welcome page has login form (send to LoginAction)
>> - LoginAction reads username and password and sends to ListStuffAction
>> - ListStuffAction reads stuff from database and sends to Stuff page
>> - Stuff page lists the stuff.
>>
>> In Suff page, I also have a "welcome *username*, your password is
>> *password*"
>>
>> Now, in LoginAction the username and password are in the value Stack and
>> I
>> can access them. But when I reach the Stuff page, I get an odd "Welcome,
>> <
>> .
>> Your password is <".
>>
>> I'm guessing the value stack isn't sent among actions. I tried making
>> LoginAction's result to be of type ServletActionRedirectResult and
>> ActionChainResult, but both failed.
>>
>> My questions are:
>>
>> 1) How can values in the value stack be sent among actions, so that they
>> are
>> available in the final web page?
>> 2) Isn't this a common scenario in struts2's web development?
>>
>> The reason I was trying this approach is the fact that I want to use the
>> ListStuffAction repeatedly: when a user logs in, after a user inserts a
>> new
>> record so that the list can be updated with the new value, etc.
>>
>>
>> Thank you for your answers!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Sending-value-stack-from-Action-A-to-Action-B-tf4312075.html#a12290298
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: RE Sending value stack from Action A to Action B
Posted by Laszlo Borsos <bl...@freemail.hu>.
I haven't tried it yet, but the Chaining Interceptor is also meant for
this purpose.
MLENEVEUT@abusinessware.com wrote:
>> 1) How can values in the value stack be sent among actions, so that they
> are
>> available in the final web page?
>
> Put your values in HttpSession
>
>
>
>
>
> wild_oscar <mi...@almeida.at>
> 22/08/2007 16:48
> Veuillez répondre à
> "Struts Users Mailing List" <us...@struts.apache.org>
>
>
> A
> user@struts.apache.org
> cc
>
> Objet
> Sending value stack from Action A to Action B
>
>
>
>
>
>
>
> Being new to Struts2, I was searching for an answer to a use case I
> developed:
>
> - Welcome page has login form (send to LoginAction)
> - LoginAction reads username and password and sends to ListStuffAction
> - ListStuffAction reads stuff from database and sends to Stuff page
> - Stuff page lists the stuff.
>
> In Suff page, I also have a "welcome *username*, your password is
> *password*"
>
> Now, in LoginAction the username and password are in the value Stack and I
> can access them. But when I reach the Stuff page, I get an odd "Welcome, <
> .
> Your password is <".
>
> I'm guessing the value stack isn't sent among actions. I tried making
> LoginAction's result to be of type ServletActionRedirectResult and
> ActionChainResult, but both failed.
>
> My questions are:
>
> 1) How can values in the value stack be sent among actions, so that they
> are
> available in the final web page?
> 2) Isn't this a common scenario in struts2's web development?
>
> The reason I was trying this approach is the fact that I want to use the
> ListStuffAction repeatedly: when a user logs in, after a user inserts a
> new
> record so that the list can be updated with the new value, etc.
>
>
> Thank you for your answers!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE Sending value stack from Action A to Action B
Posted by ML...@abusinessware.com.
>1) How can values in the value stack be sent among actions, so that they
are
>available in the final web page?
Put your values in HttpSession
wild_oscar <mi...@almeida.at>
22/08/2007 16:48
Veuillez répondre à
"Struts Users Mailing List" <us...@struts.apache.org>
A
user@struts.apache.org
cc
Objet
Sending value stack from Action A to Action B
Being new to Struts2, I was searching for an answer to a use case I
developed:
- Welcome page has login form (send to LoginAction)
- LoginAction reads username and password and sends to ListStuffAction
- ListStuffAction reads stuff from database and sends to Stuff page
- Stuff page lists the stuff.
In Suff page, I also have a "welcome *username*, your password is
*password*"
Now, in LoginAction the username and password are in the value Stack and I
can access them. But when I reach the Stuff page, I get an odd "Welcome, <
.
Your password is <".
I'm guessing the value stack isn't sent among actions. I tried making
LoginAction's result to be of type ServletActionRedirectResult and
ActionChainResult, but both failed.
My questions are:
1) How can values in the value stack be sent among actions, so that they
are
available in the final web page?
2) Isn't this a common scenario in struts2's web development?
The reason I was trying this approach is the fact that I want to use the
ListStuffAction repeatedly: when a user logs in, after a user inserts a
new
record so that the list can be updated with the new value, etc.
Thank you for your answers!
--
View this message in context:
http://www.nabble.com/Sending-value-stack-from-Action-A-to-Action-B-tf4312075.html#a12276288
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org