aspose file tools*
The moose likes Servlets and the fly likes Notify Users before session expires Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Notify Users before session expires" Watch "Notify Users before session expires" New topic
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: 61628
    
  67

Ajax is much much easier if you use one of the popular JavaScript libraries such as jQuery or Dojo.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Notify Users before session expires