• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need to call a function before Session ends

 
vinoth Robert
Ranch Hand
Posts: 31
Firefox Browser MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working in a jsp web application.
in that i am
storing the login time and logout time in database.

its working fine.....

the problem is when the session timeout (ends automatically) i could not get the logout time.


i think i need to call a function before the session timeout.

is it correct? if so how to solve this?

or any other solution?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2266
76
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robert,

You can use the HttpSessionListener for that purpose. You have to configure your listener in your web.xml. The interface consists of two methods:

public void sessionCreated(HttpSessionEvent se)
public void sessionDestroyed(HttpSessionEvent se)

Regards,
Frits
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic