You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/09/11 22:40:08 UTC
svn commit: r442340 -
/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java
Author: mmarinschek
Date: Mon Sep 11 13:40:07 2006
New Revision: 442340
URL: http://svn.apache.org/viewvc?view=rev&rev=442340
Log:
http://issues.apache.org/jira/browse/TOMAHAWK-579 - java.lang.IllegalStateException: getOutputStream() has already been called for this response error using the RI 1.2_01 and Tomahawk 1.1.3 - thanks to Mike Youngstrom for providing this patch
Modified:
myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java?view=diff&rev=442340&r1=442339&r2=442340
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/ExtensionsFilter.java Mon Sep 11 13:40:07 2006
@@ -171,10 +171,16 @@
}
else
{
- // When not filtering due to not valid content-type, deliver the byte-array instead of a charset-converted string.
- // Otherwise a binary stream get corrupted.
- servletResponse.getOutputStream().write(extendedResponse.getBytes());
- }
+
+ byte[] responseArray = extendedResponse.getBytes();
+
+ if(responseArray.length > 0)
+ {
+ // When not filtering due to not valid content-type, deliver the byte-array instead of a charset-converted string.
+ // Otherwise a binary stream gets corrupted.
+ servletResponse.getOutputStream().write(responseArray);
+ }
+ }
}
else
{