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.getOutp
is there a way I can detect this without writing any data?
No because there isn't a way in TCP/IP to detect it without writing any data.
Don't worry about it. Just complete the request actions and write the response. If the client has disappeared, that will cause an IOException: connection reset, which will be thrown into the servlet container. Nothing you have to do about that.