Author: mwringe
Date: 2010-02-19 16:37:44 -0500 (Fri, 19 Feb 2010)
New Revision: 1787
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
Throw a error message if we receive a non-text content type that contains no bytes of
data. If chars exist, these may represent an error message and these chars will be printed
in the error message. Related to GTNPORTAL-630.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-19
18:26:44 UTC (rev 1786)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-19
21:37:44 UTC (rev 1787)
@@ -366,8 +366,24 @@
else
{
response.setContentType(contentType);
- OutputStream stream = response.getOutputStream();
- stream.write(piResponse.getBytes());
+ if (piResponse.getBytes() != null)
+ {
+ OutputStream stream = response.getOutputStream();
+ stream.write(piResponse.getBytes());
+ }
+ else
+ {
+ if (piResponse.getChars() != null)
+ {
+ log.error("Received a content type of " + contentType + "
but it contains no bytes of data. Chars were unexpectantly returned instead : " +
piResponse.getChars());
+ }
+ else
+ {
+ log.error("Received a content type of " + contentType + "
but it contains no bytes of data.");
+ }
+ }
+
+
}
context.getResponse().flushBuffer();
Show replies by date