我需要从 HttpServletResponse 中“刷新”OutputStream 吗?
我已经看到 from to我应该关闭 servlet 输出流吗?我不需要关闭它,但不清楚是否需要冲洗它。我也应该从容器中期待它吗?
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
byte[] response = getResponse();
String responseType = getResponseType();
response.setContentLength(response.length);
response.setContentType(responseType);
response.getOutputStream().write(response);
response.getOutputStream().flush(); // yes/no/why?
}