mitre/HTTP-Proxy-Servlet — pull request #27 by matthias-m (2014-06-23 18:25:11+00:00)
Title: Prevent IllegalStateException during redirect

On Glassfish 3.1.2.2 in case of an redirect you get a
java.lang.IllegalStateException: PWC3990: getWriter() has already been called for this response
at org.apache.catalina.connector.Response.getOutputStream(Response.java:674)
at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:206)

First check if response is already commited before accessing the stream.