| Author |
Notify Users before session expires
|
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
Hi,
I saw in few sites, the users were getting a alert before the session expires. How to achieve that..
is their any way we can invoke the Javascript window.open from JSP before the session time.. Please assist me
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
It's usually something like a JavaScript timer plus an AJAX request to stop the session expiring (assuming the user responds) or remove the popup if they don't
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
Thanks Paul..
I googled and I got the below code.
I guess I need to submit 1 ajax request to server saving client is alive.. Am I rite.
Thanks
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Yeah.
|
 |
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
Paul I got struck in AJAX call.. Please help
Call is not going to my handler..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
Ajax is much much easier if you use one of the popular JavaScript libraries such as jQuery or Dojo.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
Finally This code works fine...... Ajax call is going to server now..
Sometimes am getting below alert
alert("Error during AJAX call. Please try again");
But still the call is going to Action handler(servlet).. Someone please assist me why am getting this error.
|
 |
 |
|
|
subject: Notify Users before session expires
|
|
|