click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1096514 - /click/trunk/click/framework/src/org/apache/click/ActionResult.java
Date Mon, 25 Apr 2011 16:45:56 GMT
Author: sabob
Date: Mon Apr 25 16:45:55 2011
New Revision: 1096514

URL: http://svn.apache.org/viewvc?rev=1096514&view=rev
Log:
Added page method getCharacterEncoding. CLK-764

Modified:
    click/trunk/click/framework/src/org/apache/click/ActionResult.java

Modified: click/trunk/click/framework/src/org/apache/click/ActionResult.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/ActionResult.java?rev=1096514&r1=1096513&r2=1096514&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/ActionResult.java (original)
+++ click/trunk/click/framework/src/org/apache/click/ActionResult.java Mon Apr 25 16:45:55
2011
@@ -560,20 +560,14 @@ public class ActionResult {
             response.setDateHeader("Expires", new Date(1L).getTime());
         }
 
-        String localContentType = getContentType();
+        response.setContentType(getContentType());
 
-        if (getCharacterEncoding() == null) {
+        String localCharacterEncoding = getCharacterEncoding();
+        if (localCharacterEncoding == null) {
 
             // Fallback to request character encoding
-            if (context.getRequest().getCharacterEncoding() != null) {
-                response.setContentType(localContentType + "; charset="
-                    + context.getRequest().getCharacterEncoding());
-            } else {
-                response.setContentType(localContentType);
-            }
-
-        } else {
-            response.setContentType(localContentType + "; charset=" + getCharacterEncoding());
+            localCharacterEncoding = context.getRequest().getCharacterEncoding();
         }
+        response.setCharacterEncoding(localCharacterEncoding);
     }
-}
+}
\ No newline at end of file



Mime
View raw message