myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r1071088 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
Date Tue, 15 Feb 2011 22:03:44 GMT
Author: bommel
Date: Tue Feb 15 22:03:43 2011
New Revision: 1071088

URL: http://svn.apache.org/viewvc?rev=1071088&view=rev
Log:
cleanup

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

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java?rev=1071088&r1=1071087&r2=1071088&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
Tue Feb 15 22:03:43 2011
@@ -53,11 +53,10 @@ public class AjaxResponseRenderer {
   public static final int CODE_NOT_MODIFIED = 304;
   public static final int CODE_RELOAD_REQUIRED = 309;
   public static final int CODE_ERROR = 500;
-
+  public static  final String CONTENT_TYPE = "application/json";
   private static final Logger LOG = LoggerFactory.getLogger(AjaxResponseRenderer.class);
 
   private EncodeAjaxCallback callback;
-  private String contentType = "application/json";
 
   public AjaxResponseRenderer() {
     callback = new EncodeAjaxCallback();
@@ -105,7 +104,7 @@ public class AjaxResponseRenderer {
   private void renderComponent(FacesContext facesContext, RenderKit renderKit, String clientId,
       UIComponent component) throws IOException {
     PrintWriter writer = getPrintWriter(facesContext);
-    ResponseWriter contentWriter = renderKit.createResponseWriter(writer, contentType, null);
+    ResponseWriter contentWriter = renderKit.createResponseWriter(writer, CONTENT_TYPE, null);
     facesContext.setResponseWriter(contentWriter);
 
     if (LOG.isDebugEnabled()) {
@@ -138,7 +137,7 @@ public class AjaxResponseRenderer {
 
   private void saveState(FacesContext facesContext, RenderKit renderKit) throws IOException
{
 
-    ResponseWriter stateWriter = renderKit.createResponseWriter(getPrintWriter(facesContext),
contentType, null);
+    ResponseWriter stateWriter = renderKit.createResponseWriter(getPrintWriter(facesContext),
CONTENT_TYPE, null);
     facesContext.setResponseWriter(stateWriter);
 
     StateManager stateManager = facesContext.getApplication().getStateManager();
@@ -168,7 +167,7 @@ public class AjaxResponseRenderer {
     } else {
       charset = "UTF-8";
     }
-    ensureContentTypeHeader(facesContext, charset, contentType);
+    ensureContentTypeHeader(facesContext, charset, CONTENT_TYPE);
 
     PrintWriter writer = getPrintWriter(facesContext);
     writer.write("{\n  \"tobagoAjaxResponse\": true,\n");



Mime
View raw message