You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2011/04/25 18:45:56 UTC

svn commit: r1096514 - /click/trunk/click/framework/src/org/apache/click/ActionResult.java

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