struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Milanovic <>
Subject Re: [Struts 2] Session scope
Date Wed, 28 May 2008 15:08:38 GMT
It seems that every request have its own scope ?! 

Milan Milanovic <> wrote: Hi,

I have one action class and two pages. When first page is called, in its execute method I
remove my session variable, like this:


and then when form from the first jsp page is submitted user enter details in the second form
and there I save those changed to session, too:

ServletActionContext.getContext().getSession().put("fruits", fruits);

Of course, I first check if there is already fruits in session. I do this because some maybe
want to go to first page to change something and then to go again to the second page to continue
entering other info. But, when I exit both page an execute method is called (with above session
remove method), and my second page is called fruits from session are read again - they are
not removed ?

Thx in advance, Milan Milanovic


  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message