Hi All,
I am facing a similar problem. I am using Struts 1.2.
I am setting session attributes in an Action -- say Action A. Then I move to
the next page and on this page I open a pop-up which calls another Action
-- say Action B.
Now, when I try to access the attributes set by Action A in Action B, I get
'null'.
I simply set the attributes as request.getSession().setAttribute("a", A); in
Action A.
I try to retrieve the attributes like
request.getSession().getAttribute("a"); in Action B.
I have cookies disabled and this is because of a client requirement.
This session thing works on all the other pages but fails at the above
mentioned instance.
Struts config for
Action A
<action path="/submitJob"
type="net.xxx.clients.xxx.xxx.view.actions.JobAction"
name="JobForm" input="/jsp/jobType.jsp" validate="true"
scope="request">
<forward name="success" path="/jsp/jobDetails.jsp" />
<forward name="failure" path="/jsp/jobType.jsp" />
</action>
Action B
<action path="/surveyorLookup"
type="net.xxx.clients.xxx.xxx.view.actions.SearchTeamMemberAction"
name="JobForm" input="/jsp/search.jsp" validate="true"
scope="request">
<forward name="success" path="/jsp/searchSurveyor.jsp"
/>
<forward name="failure" path="/jsp/error.jsp" />
</action>
As you can notice, both the actions are sharing the same form, I think it
should be possible to retrieve the
values set in the form in Action A, by Action B. Even in this case the
values I get are null.
Can anybody help me please? Thanks in advance.
Shardul.
strutstwouser wrote:
>
> Are u using Struts 1.x or 2 ? -- please paste the code from struts xml
> and how you are doing the redirect? ; will attempt to answer after
> that.
>
> -Joseph
>
> On 8/17/07, Paul Benedict <[EMAIL PROTECTED]> wrote:
>> If you switch domains or ports, you will lose your session. Sessions are
>> usually tied to cookies which have these restrictions.
>>
>> On 8/17/07, Diego Ezquerro <[EMAIL PROTECTED]> wrote:
>> >
>> > Hi to everyone.
>> >
>> > I have a problem with the session attributes in my struts app.
>> > I have a login page that checks the username and the password and if
>> it's
>> > all right, it fills the session (in the action bean) with an attributte
>> > "username" with the username introduced. The app redirects to another
>> page.
>> >
>> > When i try to obtain the username attributte in the next page, it is
>> seted
>> > to null. I have searched the web and found no answer.
>> >
>> > I hanven't invalidated the session and don't know why this is
>> happening.
>> >
>> > If anybody knows a possible reason, please tell me.
>> >
>> > Diego Ezquerro Bailac
>> > Asturias, Spain
>> >
>> >
>> >
>> > __________________________________________________
>> > Correo Yahoo!
>> > Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
>> > Regístrate ya - http://correo.espanol.yahoo.com/
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Losing-Session-attributes-tf4288159.html#a12230607
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]