[JAVA] getOutputStream() has already been called for this response

[JAVA] getOutputStream() has already been called for this response

jsp 에서 java.lang.IllegalStateException: getOutputStream() has already been called for this response 오류 발생하는 경우.

아웃풋스트림(ex : ServletOutputStream)을 사용하기 전에 out.clear() 로 JspWriter 객체를 비워주면 오류가 사라진다.

참고사이트 : https://kooremo.tistory.com/entry/javalangIllegalStateException-getOutputStream-has-already-been-called-for-this-respons