Author: wesw Date: Mon Sep 21 18:40:56 2009 New Revision: 817366 URL: http://svn.apache.org/viewvc?rev=817366&view=rev Log: WW-3187 Small refactoring
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java?rev=817366&r1=817365&r2=817366&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java Mon Sep 21 18:40:56 2009 @@ -237,16 +237,11 @@ 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 @@ if (contentCharSet != null ) { contentCharSet = conditionalParse(contentCharSet, invocation); } + else { + contentCharSet = stack.findString("contentCharSet"); + } } }