roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1086819 - /roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java
Date Wed, 30 Mar 2011 01:43:55 GMT
Author: snoopdave
Date: Wed Mar 30 01:43:54 2011
New Revision: 1086819

URL: http://svn.apache.org/viewvc?rev=1086819&view=rev
Log:
only set encoding on request if it is not already UTF-8

should eliminate silly warnings on Glassfish 

Modified:
    roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java

Modified: roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java?rev=1086819&r1=1086818&r2=1086819&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java
(original)
+++ roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java
Wed Mar 30 01:43:54 2011
@@ -65,8 +65,12 @@ public class CharEncodingFilter implemen
     throws IOException, ServletException {
         if (mLogger.isDebugEnabled()) mLogger.debug("Processing CharEncodingFilter");
         try {
-            
-            req.setCharacterEncoding("UTF-8");            
+        	if (!"UTF-8".equals(req.getCharacterEncoding())) {
+        		// only set encoding if not already UTF-8
+        		// despite the fact that this is the first filter in the chain, on Glassfish it

+        		// is already too late to set request encoding without getting a WARN level log
message
+        		req.setCharacterEncoding("UTF-8");
+        	}
             if (mLogger.isDebugEnabled()) mLogger.debug("Set request character encoding to
UTF-8");
             
         } catch (UnsupportedEncodingException e) {



Mime
View raw message