Alongwith being a good coder, try to be a good professional as well!
Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Originally posted by Sunil Vasudevan:
One dirty way of doing it is to keep a track of the time left before the session expires on the client end using a timer implemented in JavaScript (use setTimeout()).
Say 30 seconds before the session is supposed to time out (specified under your web-xml), your javascript can show a pop-up informing the user the session will expire.
This is not a good way of doing it.. But if your functionality demands it, you can...
[ April 18, 2007: Message edited by: Sunil Vasudevan ]
Originally posted by Rahul Bhattacharjee:
Sunil , will this really work ?
#1 : Each time the timeout value you changes in the web.xml you have to changes the javascript.
#2 : On what event would you be calling the javascript?
#3 : The session object is in the server. Timeout specify the maximum interval on inactivity after which the session can be invalidated and session is not thread safe , other requests can be working on the same session.
Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Originally posted by Sunil Vasudevan:
On further thoughts, we can look at using AJAX. That should provide a cleaner solution.
Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Originally posted by Sunil Vasudevan:
Please let me know if you see an issue with this approach.