0
votes
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.

2
unless you show us some relevant code, how do you think we can guess how to fix your problem?Bozho

2 Answers

6
votes

You cannot call both getOutputStream() and getWriter() on the same response. Keep in mind that JSP implicitly uses getWriter().

1
votes

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.