File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes javascript sending a request Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 15362
    
    6
take a look at onbeforeunload.

Eric
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: javascript sending a request
 
Similar Threads
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
How to make dynamic radio button checked