It seems that my session variable is deleted somehow when first action method of the second Action class is called:
MyFirstActionClass -> show first.jsp -> user click on link -> MyFirstActionClass.method where I set session variable (getSession().put("variable", new Boolean(true)); -> show second.jsp (here I see my variable) -> user click on some link -> MySecondActionClass.method->third.jsp (here I don't see my variable). I should note that in MySecondActionClass.method I don't clear session or something similar, I just add remove some other variables and set some new. -- Thx, Milan Milan Milanovic wrote: > > Hi Dave, > > > newton.dave wrote: >> >> --- On Thu, 7/31/08, Milan Milanovic <[EMAIL PROTECTED]> wrote: >>> No one have any idea how to access session variable in jsp >>> in this kind of simple scenario ? >> >> That's one explanation. >> >>>> So, scenario is like this: >>>> [...] >> >> I am unable to duplicate the inability to test session variables for >> non-existence/null. >> >> If I have an action implementing SessionAware (properly), set "foo1" into >> session, and do not set "foo2" into session, the following tests work: >> >> <s:if test="#session.foo1 == null"> >> ... >> <s:if test="#session.foo2 != null"> >> ... >> >> They continue to work if I go through multiple actions using the exact >> same JSP to test for their presence/non-presence. >> > > Yes, I tried with this, but session variable is not found. > > I think that you didn't understand what is my scenario. I have implemented > SessionAware interface for both of my action classes and that works > perfectly in the case of jsp's that are connected to that classes. > But in this case, I have this: > > MyFirstActionClass -> show first.jsp -> user click on link -> > MyFirstActionClass.method where I set session variable > (getSession().put("variable"); -> show second.jsp -> user click on some > link -> MySecondActionClass.method is called to return some results -> > show third.jsp with those results, and in this page I test if my > session.variable is present, but there is not !! But, my variables that > are set in MySecondActionClass.method are present in session for > third.jsp! > > What is the problem ? > > -- > Thx in advance, Milan > > > > newton.dave wrote: >> >> It is likely you are doing something wrong. I suppose that means you'll >> need to post the relevant SessionAware implementation, the code that sets >> the session variable(s), any action code in the application path that >> could modify session variables, the JSP that currently doesn't work, and >> any variants of the JSP code you've tried that also hasn't worked. >> >> Dave >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756151.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]