I have done this in the past (not in Wicket). The problem I ran into was JavaScript alerts stopping the JavaScript timer thread until the user closed the alert box. I used a modal window for my warning message to prevent that problem.

On 6/9/2011 2:25 AM, Martin Grigorov wrote:
Yep, this will work.

For each request to the page you'll have to reset the JS counter.
This JS counter will count from session-timeout to 0 and display some
notification when it reaches the treshold.
But you have to assure that this counter is reset for *every* request.

On Thu, Jun 9, 2011 at 11:11 AM, Arjun Dhar<dhar...@yahoo.com>  wrote:
I just had an idea to solve both the problems. (please see if it makes sense)

Well, what if we on every Page request tell the Browser how much time it has
left = Session Duration. (Pass it via some param or header script variable)
And let the Browser do house keeping for that window session.

I'll put a script via WebPage.setHeader(...) in my base class; extended by
all pages that use a session.
The rest is taken care by the client.

..though am not sure if there is a way for me to inject into all pages that
use a particular session object automatically or I should keep it simple and
put it in the base WebPage class?
(All WebPages may not share a common parent)


thanks

-----
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Graceful-Session-Expiry-tp3584660p3584943.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to