struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <bill.siggel...@mirant.com>
Subject RE: Struts and session
Date Tue, 17 Dec 2002 14:24:49 GMT
Doug, the servlet container is responsible for invalidating the session based on the configured
timeout.  If you want to take some action when that occurs you should register an HttpSessionListener
to receive notification of session lifecycle events.  For complete details you can read the
Servlet spec and/or the Servlet 2.3 Javadocs.

-----Original Message-----
From: Doug Ogateter [mailto:hinbsls@yahoo.ca]
Sent: Tuesday, December 17, 2002 12:33 AM
To: Struts Users Mailing List
Subject: Struts and session


Greetings:

I am using struts1.1b2 to implement a web application. I have a question regarding to implementing
session timeout. When session is invalidated, user who has logged in the system should be
forwarded to login page. I am not clear about the followings, and hope someone can help me
out.

1. Who will invalidate the session when timeout? Servlet container will do it automatically?

2. Should I use request.getSession(false) to check if session is timeout? If so, that means
for every request, it will check if session is invaildate. Will it cause performance problem?
If not, which methods should I call to check it?

3. If I should use request.getSession(false) to check session timeout, where should I write
the code? Should I write the code in every action class?

4. There are many methods related to session, such as getCreationTime, getLastAccessedTime,..Where
and how should I use them in the implementation?

5.From my understanding, I can set timeout in web.xml or use setMaxInactiveIterval(int ..).
Usually which way should be use?

6. After user login, I want to forward the user to the page where he was when session timeout.
Where should I save the information(with the information, I know where I should forward the
user to)?

I searched the archive. However, it seems that I can't find the specific info.

Your help is highly appreicated.

Doug


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message