Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stopping a backend process if user closes the browser window

 
jasdeep parmar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far i know , you cant detect the browser window close event on server side . I guess David mentioned about session-time out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic