JSF - Abort method when closing browser

Asked

Viewed 105 times

0

I have a report that depending on the filter applied can take a long time to finish. In some occasions the user gives up waiting and close the browser, it happens that the query is still running on Tomcat. Is there a way to invalidate Session when the user closes the browser? I’m working with JSF 2.2 and Viewscoped on this screen.

  • See if it helps you https://stackoverflow.com/questions/23979711/how-to-call-predestroy-on-browser-close-event

  • My suggestion: after the customer asks for the report generation, start a javascript on the page. This would call the server at each time interval, to warn that the user is still on the same screen. If after timeout time the server did not receive the javascript request, abort the report thread,

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.