tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1350247 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/Context.java java/org/apache/catalina/connector/Response.java java/org/apache/catalina/core/StandardContext.java java/org/apache/catalina/startup/FailedContext.java
Date Thu, 14 Jun 2012 14:04:20 GMT
Author: markt
Date: Thu Jun 14 14:04:20 2012
New Revision: 1350247

URL: http://svn.apache.org/viewvc?rev=1350247&view=rev
Log:
Deprcate code to be removed in 8.0.x

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1350241,1350243

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java?rev=1350247&r1=1350246&r2=1350247&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java Thu Jun 14 14:04:20 2012
@@ -20,6 +20,7 @@ package org.apache.catalina;
 
 
 import java.net.URL;
+import java.util.Locale;
 import java.util.Set;
 
 import javax.servlet.ServletContainerInitializer;
@@ -169,7 +170,9 @@ public interface Context extends Contain
 
     /**
      * Return the Locale to character set mapper for this Context.
+     * @deprecated Use {@link #getCharset(Locale)}
      */
+    @Deprecated
     public CharsetMapper getCharsetMapper();
 
 
@@ -177,11 +180,22 @@ public interface Context extends Contain
      * Set the Locale to character set mapper for this Context.
      *
      * @param mapper The new mapper
+     *
+     * @deprecated
      */
+    @Deprecated
     public void setCharsetMapper(CharsetMapper mapper);
 
 
     /**
+     * Obtain the character set name to use with the given Locale. Note that
+     * different Contexts may have different mappings of Locale to character
+     * set.
+     */
+    public String getCharset(Locale locale);
+
+
+    /**
      * Return the URL of the XML descriptor for this context.
      */
     public URL getConfigFile();

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=1350247&r1=1350246&r2=1350247&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java Thu Jun 14 14:04:20
2012
@@ -45,7 +45,6 @@ import org.apache.catalina.Globals;
 import org.apache.catalina.Session;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.security.SecurityUtil;
-import org.apache.catalina.util.CharsetMapper;
 import org.apache.catalina.util.DateTool;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.SessionConfig;
@@ -885,12 +884,10 @@ public class Response
             return;
         }
 
-        CharsetMapper cm = getContext().getCharsetMapper();
-        String charset = cm.getCharset( locale );
-        if ( charset != null ){
+        String charset = getContext().getCharset(locale);
+        if (charset != null) {
             coyoteResponse.setCharacterEncoding(charset);
         }
-
     }
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1350247&r1=1350246&r2=1350247&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Thu Jun 14 14:04:20
2012
@@ -33,6 +33,7 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
@@ -1481,6 +1482,13 @@ public class StandardContext extends Con
 
     }
 
+
+    @Override
+    public String getCharset(Locale locale) {
+        return getCharsetMapper().getCharset(locale);
+    }
+
+
     /**
      * Return the URL of the XML descriptor for this context.
      */

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java?rev=1350247&r1=1350246&r2=1350247&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java Thu Jun 14 14:04:20
2012
@@ -19,6 +19,7 @@ package org.apache.catalina.startup;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
 import java.net.URL;
+import java.util.Locale;
 import java.util.Set;
 
 import javax.naming.directory.DirContext;
@@ -276,12 +277,17 @@ public class FailedContext extends Lifec
     @Override
     public boolean getAvailable() { return false; }
 
+    @Deprecated
     @Override
     public CharsetMapper getCharsetMapper() { return null; }
+    @Deprecated
     @Override
     public void setCharsetMapper(CharsetMapper mapper) { /* NO-OP */ }
 
     @Override
+    public String getCharset(Locale locale) { return null; }
+
+    @Override
     public boolean getConfigured() { return false; }
     @Override
     public void setConfigured(boolean configured) { /* NO-OP */ }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message