[gatein-commits] gatein SVN: r1987 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/webui/workspace and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Mar 4 16:59:51 EST 2010
Author: mwringe
Date: 2010-03-04 16:59:51 -0500 (Thu, 04 Mar 2010)
New Revision: 1987
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/OutputStreamPrinter.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java
Log:
If we encounter a ClientAbortException during the handling of the portlet markup header processing, then we should ignore this error as it specifies that the client browser has prematurely closed the conneciton (GTNPORTAL-814).
Add missing error handling in OutputStream printer.
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/OutputStreamPrinter.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/OutputStreamPrinter.java 2010-03-04 20:42:21 UTC (rev 1986)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/OutputStreamPrinter.java 2010-03-04 21:59:51 UTC (rev 1987)
@@ -407,6 +407,16 @@
*/
public void flushOutputStream() throws IOException
{
- out.flush();
+ if (!failed)
+ {
+ try
+ {
+ out.flush();
+ }
+ catch (IOException e)
+ {
+ handle(e);
+ }
+ }
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java 2010-03-04 20:42:21 UTC (rev 1986)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplicationLifecycle.java 2010-03-04 21:59:51 UTC (rev 1987)
@@ -19,9 +19,8 @@
package org.exoplatform.portal.webui.workspace;
-import java.io.CharArrayWriter;
+import java.io.IOException;
import java.io.OutputStream;
-import java.io.Writer;
import org.exoplatform.commons.utils.PortalPrinter;
import org.exoplatform.portal.application.PortalRequestContext;
@@ -98,10 +97,23 @@
context.setWriter(parentWriter);
processRender(uicomponent, context, "system:/groovy/portal/webui/workspace/UIPortalApplication.gtmpl");
- //flush the parent writer to the output stream so that we are really to accept the child content
- parentWriter.flushOutputStream();
- //now that the parent has been flushed, we can flush the contents of the child to the output
- childWriter.flushOutputStream();
+ try
+ {
+ //flush the parent writer to the output stream so that we are really to accept the child content
+ parentWriter.flushOutputStream();
+ //now that the parent has been flushed, we can flush the contents of the child to the output
+ childWriter.flushOutputStream();
+ }
+ catch (IOException ioe)
+ {
+ //We want to ignore the ClientAbortException since this is caused by the users
+ //browser closing the connection and is not something we should be logging.
+ if (!ioe.getClass().toString().contains("ClientAbortException"))
+ {
+ throw ioe;
+ }
+
+ }
}
public void processRender(UIPortalApplication uicomponent, WebuiRequestContext context, String template) throws Exception
More information about the gatein-commits
mailing list