Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Logoff JSP  RSS feed

 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a client server application. When user login data base filed get updates to �userlogin� b,coz other users must know how many and who is online. As usual there is a link to logoff and when clicked jsp file gets called and the database is updated to �userlogoff�

without clicking the logoff link if the user
1.close the IE (Alt+F4 or close button)

or

2.change the site(selecting a site from Favorites, IE history, IE search, or simply typing a address on the address bar or drag and drop a saved html link or a page)



3.any other way

how can I call my jsp page to change the database?

Thank You
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a sessionListener.
The put your code to remove the user from the active database in the sessionDestroyed method.

BTW: I have a demo app that does just this at:
http://simple.souther.us/not-so-simple.html
Look for SessionMonitor
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!