Detecting client disconnect in tomcat servlet?

后端 未结 3 798
青春惊慌失措
青春惊慌失措 2020-11-28 14:08

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

3条回答
  •  渐次进展
    2020-11-28 14:26

    Have you tried to flush the buffer of the response: response.flushBuffer(); Seems to throw an IOException when the client disconnected.

提交回复
热议问题