struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shirishchandra.sakh...@ubs.com
Subject RE: Struts and session
Date Tue, 17 Dec 2002 14:41:19 GMT
>>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?

That is the only way to know if the session is invalid..(or similarly u can do 
request.getSession(true) and check isNew on session)And yes for every request u 
have to do this...SO typically some where in your applications abstract action 
class U will have this as a preprocessing before the perform is called...

>>4.From my understanding, I can set timeout in web.xml or use 
setMaxInactiveIterval(int ..). Usually which way should be use?
I think the web.xml is better place as it becomes declarative instead of 
hardcoded.So just to check the time out, u dont need a next build.

>>5. 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 think one of teh ways to do this might be using cookies ..Check teh 
documentation for more details as i aslo dont know exactly how to do this.But u 
can use cookies to store user info.And in his case, as session is already timed 
out, i think this is the easiest way to save the information about the last 
action..

regards,
Shirish

-----Original Message-----
From: hinbsls [mailto:hinbsls@yahoo.ca]
Sent: Tuesday, December 17, 2002 3:27 PM
To: struts-user
Cc: hinbsls
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. 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?

2. 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?

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

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

5. 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




---------------------------------
Post your free ad now! Yahoo! Canada Personals


--
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