본문 바로가기

Programming/Jsp

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

JSP 를 Servlet 으로 변하는 과정에 생기는 OutputStream 때문인데, 다음을 통해 JSP 자체의 OutputStream 을 제거할 필요가 있다. 반드시 getOutputStream() 앞에 위치시킨다.

out.clear();
out=pageContext.pushBody();