When processing a large amount of data in a JSP or Servlet, is there anyway to know that the user has either used the "Stop" button, or closed the window?
Although JSPs/servlets shield you from the raw socket connection, you can test the outputstream to see if it is still usable and thereby determine whether the connection is still open. To test the outputstream, try the following snippet:
<% out.print(" "); out.flush(); %>
If the socket is closed (because the user has hit Stop or closed the window), the outputstream is closed and you will get an IOException.