日期:2014-05-16  浏览次数:20304 次

jsp中的out对象 和 servlet中的response.getOutputStream()
unwinding now
java.lang.IllegalStateException: WRITER

?web容器生成的servlet代码中有out.write(””),这个和JSP中调用的response.getOutputStream()产生冲突.
即 Servlet规范说明,不能既调用 response.getOutputStream(),又调用response.getWriter(),无论先调用哪一个,在调用第二个时候应会抛出 IllegalStateException,因为在jsp中,out变量是通过response.getWriter得到的,在程序中既用了 response.getOutputStream,又用了out变量,故出现以上错误。

转自:http://blog.csdn.net/hejunpurple/article/details/5132727

?

我改成都用response.getOutputStream了解决

?