开发者

verify connection in jersey

I want to be able to verify that the connection is still alive (client not dead) when sending a response from a Jersey (jax-rs) resource. The reason is that if I just return the response object and the client is dead, the response is lost witho开发者_如何转开发ut knowing that the client did not receive it.


httpContext.getResponse().setResponse(myResponse)
try {
  httpContext.getResponse().getOutputStream().write(new byte[]{})
} catch (Exception e) {
  // writing of headers failed. 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜