This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes Stopping a backend process if user closes the browser window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Stopping a backend process if user closes the browser window" Watch "Stopping a backend process if user closes the browser window" New topic
Author

Stopping a backend process if user closes the browser window

jasdeep parmar
Greenhorn

Joined: Oct 06, 2008
Posts: 20
hi,

I take the user input from UI in a jsp page and send the info to server, retrieve the data and generate a PDF file on the server and send that as temp file for user to be able to view it.
Now if the user closes the browser I need to stop the processing of the data in back end also
can any one please suggest how can I do that or find info to do that..

thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You could try using a session listener, assuming you have a link between the session and the process. You could also have a periodic Ajax call made from your page and if it stops being made the process ends.
jasdeep parmar
Greenhorn

Joined: Oct 06, 2008
Posts: 20
hi,
I dont' have link between session and process.
I don't have much experience with Ajax either, can you suggest how it can be implemented or where I can find similar
implementations or something that give me an idea as how to implement that..

thanks
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

As far i know , you cant detect the browser window close event on server side . I guess David mentioned about session-time out
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stopping a backend process if user closes the browser window
 
Similar Threads
logout on browser close
please help me spring mvc
Session
Session handling
Do stuffs when browser closes