myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r582609 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxResponseRenderer.java
Date Sun, 07 Oct 2007 10:56:22 GMT
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);
 



Mime
View raw message