ERROR [Engine] standardwrappervalve[jsp]: Servlet.service () for Servlet JSP threw exception
Java.lang.IllegalStateException:getOutputStream () have already been called for this response
From the Internet to find the following information, a comprehensive analysis of the cause:
This is a out.write ("") in the servlet code generated by the Web container, which conflicts with the Response.getoutputstream () called in the JSP.
That is, the servlet specification description, cannot call Response.getoutputstream (), and call Response.getwriter (), regardless of which one is called first, should be thrown at the second time of the call IllegalStateException, because in the JSP, the out variable is obtained through the Response.getwriter, in the program both uses the Response.getoutputstream, and uses the out variable, therefore appears above error.
Solution:
1. Add in the program:
Out.clear ();
out = Pagecontext.pushbody ();
It can be;
2, do not write between%)(% including spaces and newline characters.
3, you need to flush () when you write a picture on the page
OutputStream Output=response.getoutputstream ();
Output.flush ();
4, the page is determined to write <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
Java.lang.IllegalStateException:getOutputStream () have already been called for this response