From f01991d171c7079a3d0f0a68e0936f22dff7a8ff Mon Sep 17 00:00:00 2001 From: Wesley Wannemacher Date: Mon, 21 Sep 2009 18:40:56 +0000 Subject: [PATCH] WW-3187 Small refactoring git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@817366 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/struts2/dispatcher/StreamResult.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java b/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java index 64c26f221..fe2f99488 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java @@ -237,16 +237,11 @@ public class StreamResult extends StrutsResultSupport { throw new IllegalArgumentException(msg); } - /* - if (contentCharSet != null && contentCharSet.startsWith("${")) { - contentCharSet = (String)invocation.getStack().findValue(contentCharSet, String.class); - } - */ // Find the Response in context HttpServletResponse oResponse = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE); // Set the content type - if (contentCharSet != null ) { + if (contentCharSet != null && ! contentCharSet.equals("")) { oResponse.setContentType(conditionalParse(contentType, invocation)+";charset="+contentCharSet); } else { @@ -339,6 +334,9 @@ public class StreamResult extends StrutsResultSupport { if (contentCharSet != null ) { contentCharSet = conditionalParse(contentCharSet, invocation); } + else { + contentCharSet = stack.findString("contentCharSet"); + } } }