Repository: struts Updated Branches: refs/heads/develop 6d62aaedb -> 1a034053b
WW-4391 FreemarkerResult uses response content encoding in first place Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/1a034053 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/1a034053 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/1a034053 Branch: refs/heads/develop Commit: 1a034053bcf82ce05fe21680ca658ddae03bb159 Parents: 6d62aae Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Thu Aug 21 20:58:10 2014 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Thu Aug 21 20:58:10 2014 +0200 ---------------------------------------------------------------------- .../org/apache/struts2/views/freemarker/FreemarkerResult.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/1a034053/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java index 3ded53b..95e4073 100644 --- a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java +++ b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java @@ -343,7 +343,10 @@ public class FreemarkerResult extends StrutsResultSupport { contentType = "text/html"; } - String encoding = template.getEncoding(); + String encoding = response.getCharacterEncoding(); + if(encoding == null) { + encoding = template.getEncoding(); + } if (encoding != null) { contentType = contentType + "; charset=" + encoding;