我是否需要从HttpServletResponse中"刷新"OutputStream?
我已经看到了应该关闭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?
}
Run Code Online (Sandbox Code Playgroud)