java.lang.IllegalStateException: getWriter() has already been called for this response

异常:
java.lang.IllegalStateException: getWriter() has already been called for this response
原因:
response.getWriter() 已经被使用
解决:

ServletOutputStream outputStream = response.getOutputStream();
        PrintWriter printWriter = new PrintWriter(outputStream, true);
        printWriter.write(form);//直接将完整的表单html输出到页面
        printWriter.flush();
        if (printWriter != null) {
            printWriter.close();
        }

你可能感兴趣的:(java.lang.IllegalStateException: getWriter() has already been called for this response)