Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
该文档解释说,如果发生输入或输出异常(DRY ;) ,该HttpServletResponse#sendError()方法将引发。IOException
HttpServletResponse#sendError()
IOException
我找不到任何使此方法引发异常的情况,有吗?
HTTP 是通过 TCP 发送的,因此您可以放心地假设底层的某个地方HttpServletRequest存在HttpServletResponseaSocketInputStream和 a SocketOutputStream。
HttpServletRequest
HttpServletResponse
SocketInputStream
SocketOutputStream
如果用户关闭浏览器或客户端或服务器端的网络出现故障,则服务器将无法接收请求或发送响应。如果断开连接发生在服务器正在处理的过程中sendError(),那么在写入SocketOutputStream.
sendError()