I am not familiar with Apache CXF , but the following should apply to any Java Servlet base.
To determine if the user is disabled (stop button, closed browser, etc.), the server should try to send the packet. If the TCP / IP connection has been closed, an IOException will be IOException .
Theoretically, a Java application could send a space character at different points during processing. IOException will signal that the client has left, and processing may be interrupted.
However, there may be several problems with this method:
Sending characters during processing will cause the response to be "fixed", so it may not be possible to set HTTP headers, cookies, etc. based on the result of lengthy server processing.
If the output stream is buffered, space characters will not be sent immediately, thereby not performing an adequate test. It is possible to use flush() as a workaround.
It may be difficult to implement this method for a given structure or viewing technology (JSP, etc.). For example, the page rendering code will not be able to send the content type after the response has been committed.
John vasileff
source share