You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/03/03 14:08:21 UTC

svn commit: r1573554 - /myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java

Author: lofwyr
Date: Mon Mar  3 13:08:21 2014
New Revision: 1573554

URL: http://svn.apache.org/r1573554
Log:
cleanup

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java?rev=1573554&r1=1573553&r2=1573554&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/AjaxUtils.java Mon Mar  3 13:08:21 2014
@@ -21,17 +21,12 @@ package org.apache.myfaces.tobago.ajax;
 
 
 import org.apache.myfaces.tobago.internal.ajax.AjaxInternalUtils;
-import org.apache.myfaces.tobago.internal.util.ResponseUtils;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -115,47 +110,4 @@ public final class AjaxUtils {
     }
     return added;
   }
-
-  /**
-   * @deprecated since 2.0.0. Is no longer needed
-   */
-  public static boolean redirect(final FacesContext facesContext, final String url) throws IOException {
-    if (!isAjaxRequest(facesContext)) {
-      return false;
-    }
-    final HttpServletResponse httpServletResponse
-          = (HttpServletResponse) facesContext.getExternalContext().getResponse();
-    final Writer writer = httpServletResponse.getWriter();
-    final String contentType = "application/json; charset=UTF-8";
-    ResponseUtils.ensureContentTypeHeader(facesContext, contentType);
-    ResponseUtils.ensureNoCacheHeader(facesContext);
-    redirectInternal(writer, url);
-    writer.close();
-    facesContext.responseComplete();
-    return true;
-  }
-
-  /**
-   * @deprecated since 2.0.0. Is no longer needed
-   */
-  private static void redirectInternal(final Writer writer, final String url) throws IOException {
-    writer.flush(); // is needed in some cases, e. g. TOBAGO-1094
-    writer.write("{\n  \"tobagoAjaxResponse\": true,\n");
-    writer.write("  \"responseCode\": 302,\n");
-    writer.write("  \"location\": \"");
-    writer.write(url);
-    writer.write("\"\n}\n");
-    writer.flush();
-  }
-
-  /**
-   * @deprecated since 2.0.0. Is no longer needed
-   */
-  public static void redirect(final HttpServletResponse response, final String url) throws IOException {
-    final PrintWriter writer = response.getWriter();
-    final String contentType = "application/json; charset=UTF-8";
-    ResponseUtils.ensureContentTypeHeader(response, contentType);
-    ResponseUtils.ensureNoCacheHeader(response);
-    redirectInternal(writer, url);
-  }
 }