问题
java.lang.IllegalStateException: PWC3990: getWriter() has already been called for this response
How to solve this error? I run a simple servlet code to display the bar graph.
回答1:
You cannot call both getOutputStream()
and getWriter()
on the same response. Keep in mind that JSP implicitly uses getWriter()
.
回答2:
Also make sure that the request is not being redirected to current servlet from some place else. If it is, then there is a high probability that one of getOutputStream()
or getWriter()
has already been called on it.
来源:https://stackoverflow.com/questions/4312309/illegalstateexception-pwc3990-getwriter-has-already-been-called-for-this-res