You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2007/10/07 12:56:22 UTC

svn commit: r582609 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java

Author: weber
Date: Sun Oct  7 03:56:14 2007
New Revision: 582609

URL: http://svn.apache.org/viewvc?rev=582609&view=rev
Log:
Ajax requests needs a different content-type.
<http://issues.apache.org/jira/browse/TOBAGO-503>
  fix NPE on CODE_RELOAD_REQUIRED

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java?rev=582609&r1=582608&r2=582609&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java Sun Oct  7 03:56:14 2007
@@ -210,7 +210,12 @@
     RequestUtils.ensureEncoding(externalContext);
     ResponseUtils.ensureNoCacheHeader(externalContext);
     UIComponent page = ComponentUtil.findPage(facesContext);
-    String charset = (String) page.getAttributes().get(ATTR_CHARSET);
+    String charset;
+    if (page != null) {  // in case of CODE_RELOAD_REQUIRED page is null
+      charset = (String) page.getAttributes().get(ATTR_CHARSET);
+    } else {
+      charset = "UTF-8";
+    }
     ensureContentTypeHeader(facesContext, charset, contentType);
     StringBuilder buffer = new StringBuilder(responseCode);