• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Notify Users before session expires

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul I got struck in AJAX call.. Please help

Call is not going to my handler..

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax is much much easier if you use one of the popular JavaScript libraries such as jQuery or Dojo.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic