Permalink
Browse files

MYFACES-3695 'Cannot set header. Response already committed.' on WebS…

…phere Application Server 7 and 8 (do not write header if response was already committed)

git-svn-id: https://svn.apache.org/repos/asf/myfaces/core/trunk@1461883 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 4d021b6 commit 6ee0c62d7d52b09415dc2229cb190904fd0caa5e Leonardo Uribe committed Mar 27, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
@@ -405,7 +405,10 @@ public void handleResourceRequest(FacesContext facesContext) throws IOException
{
int count = pipeBytes(in, out, buffer);
//set the content lenght
- httpServletResponse.setContentLength(count);
+ if (!httpServletResponse.isCommitted())
+ {
+ httpServletResponse.setContentLength(count);
+ }
}
finally
{

0 comments on commit 6ee0c62

Please sign in to comment.