You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Peter L. Berghold" <pe...@berghold.net> on 2007/04/12 17:45:12 UTC

Losing session attributes between requests...

Hi folks,

Have just started seeing a new problem in an application that is
baffling me.  I run this using Struts 1.3 on an Apache Tomcat server as
I have been for a while. 

What I'm seeing is on one form I have information stashed away in a
session as a session attribute as such: 

request.getSession().setAttribute("semester",semester);

When a choice is made from a particular screen (in this case "schedule
class") we switch to a new form and during the reset() phase of this we
pull the attribute out again as such:

Semester semester = (Semester) 
         request.getSession().getAttribute("semester");

Now, this worked before, and now it isn't.

Another oddity is when submit is being hit on that form we take another
trip through reset() it seems which is not the behavior I expected. 


Any thoughts anybody? 



-- 
Peter L. Berghold                               Unix Professional
Peter@Berghold.Net   AIM: redcowdawg YIM: blue_cowdawg
"Those who fail to learn from history are condemned to repeat it."

SOLVED!!!! Re: Losing session attributes between requests...

Posted by "Peter L. Berghold" <pe...@berghold.net>.
Nevermind folks... I found it.

I found a particularly inventive way of shooting myself in the foot when
I installed a session listener. 

The offending line: 

session.setMaxInactiveInterval(3600); 

which was set originally to a ridiculously low value. That's what I get
for developing code while watching TV at the same time. :-/ 


-- 
Peter L. Berghold                               Unix Professional
Peter@Berghold.Net   AIM: redcowdawg YIM: blue_cowdawg
"Those who fail to learn from history are condemned to repeat it."