This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes javascript sending a request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript sending a request" Watch "javascript sending a request" New topic
Author

javascript sending a request

Antonio Giovanni
Ranch Hand

Joined: Jun 27, 2005
Posts: 85
Hi all,..

I need some help on this.. i am not a javascript expert

IS there a way that you can send a request to Servlet from javascript??
If so, please let me know. I appreciate your help on this matter.

This is my issue,.. presently working on an intranet application, where users do not log off but close the browser, i do not want to use session time-out and HttpSessionListener to handle removing the session on the server.. because for some reasons we are putting a big value for time-out .. so somehow with a cool javascript i can detect a browser close and ,.. in the javascript when a browser is closed i want to send a request to a servlet which handles the Log Off, .. which in other words .. i want to clear the session on the server even if a user closes the browser, by detecting browser close and then sending a request to servlet..

All the users use IE , so i have no problem to check if this javascript is working fine in all browsers or not...

Thanks again for your help.

PS: this is the link to the javascript for detecting browser close and atleat it is working fine with IE
http://www.jguru.com/faq/view.jsp?EID=1211863
[ October 28, 2005: Message edited by: Bear Bibeault ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
take a look at onbeforeunload.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript sending a request
 
Similar Threads
How to make dynamic radio button checked
Detecting Crashes in JBoss 4.0.2
Filter vs Listener to keep track of session instances
how to send email from java program
Collaboration between Struts Actions and plain old Servlets