tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1222690 - in /tomcat/trunk: java/org/apache/catalina/valves/ExtendedAccessLogValve.java webapps/docs/config/valve.xml
Date Fri, 23 Dec 2011 14:36:22 GMT
Author: markt
Date: Fri Dec 23 14:36:22 2011
New Revision: 1222690

URL: http://svn.apache.org/viewvc?rev=1222690&view=rev
Log:
Avoid deprecated code and provide consistent output regardless of
platform

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
    tomcat/trunk/webapps/docs/config/valve.xml

Modified: tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java?rev=1222690&r1=1222689&r2=1222690&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java Fri Dec 23 14:36:22
2011
@@ -19,6 +19,7 @@ package org.apache.catalina.valves;
 
 import java.io.IOException;
 import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
 import java.net.InetAddress;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
@@ -404,7 +405,12 @@ public class ExtendedAccessLogValve exte
             if (null==value || value.length()==0) {
                 return null;
             }
-            return URLEncoder.encode(value);
+            try {
+                return URLEncoder.encode(value, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // Should never happen - all JVMs are required to support UTF-8
+                return null;
+            }
         }
 
         @Override

Modified: tomcat/trunk/webapps/docs/config/valve.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/valve.xml?rev=1222690&r1=1222689&r2=1222690&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/valve.xml (original)
+++ tomcat/trunk/webapps/docs/config/valve.xml Fri Dec 23 14:36:22 2011
@@ -481,7 +481,7 @@
     <li><b><code>x-A(XXX)</code></b> for the servlet context
attribute with name XXX</li>
     <li><b><code>x-C(XXX)</code></b> for the first cookie with
name XXX</li>
     <li><b><code>x-O(XXX)</code></b> for a concatenation of
all outgoing response headers with name XXX</li>
-    <li><b><code>x-P(XXX)</code></b> for the URL encoded request
parameter with name XXX</li>
+    <li><b><code>x-P(XXX)</code></b> for the URL encoded (using
UTF-8) request parameter with name XXX</li>
     <li><b><code>x-R(XXX)</code></b> for the request attribute
with name XXX</li>
     <li><b><code>x-S(XXX)</code></b> for the session attribute
with name XXX</li>
     </ul>



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


Mime
View raw message