Detecting client disconnect in tomcat servlet?

Posted by Seth on Stack Overflow See other posts from Stack Overflow or by Seth
Published on 2010-06-02T22:55:24Z Indexed on 2010/06/03 0:14 UTC
Read the original article Hit count: 300

Filed under:
|
|

How can I detect that the client side of a tomcat servlet request has disconnected? I've read that I should do a response.getOutputStream().print(), then a response.getOutputStream().flush() and catch an IOException, but is there a way I can detect this without writing any data?

© Stack Overflow or respective owner

Related posts about java

Related posts about servlets