portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r332664 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet: ServletRequestFactoryImpl.java ServletRequestImpl.java
Date Fri, 11 Nov 2005 22:51:18 GMT
Author: shinsuke
Date: Fri Nov 11 14:51:16 2005
New Revision: 332664

URL: http://svn.apache.org/viewcvs?rev=332664&view=rev
Log:
fixed encoding handling issue(input string from form is garbage..)

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java?rev=332664&r1=332663&r2=332664&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java
Fri Nov 11 14:51:16 2005
@@ -55,20 +55,6 @@
         {
             HttpServletRequest servletRequest = createRequest(request, window);
 
-            // Set page encoding in order to parse the form data correctly
-            String preferedEnc = (String) request
-                    .getAttribute(PortalReservedParameters.PREFERED_CHARACTERENCODING_ATTRIBUTE);
-            if (preferedEnc != null)
-            {
-                try
-                {
-                    servletRequest.setCharacterEncoding(preferedEnc);
-                }
-                catch (UnsupportedEncodingException e)
-                {
-                    ;
-                }
-            }
             return servletRequest;
         }
         else

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java?rev=332664&r1=332663&r2=332664&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java
Fri Nov 11 14:51:16 2005
@@ -144,8 +144,9 @@
                 }
             }
 
+            String encoding = (String) getRequest().getAttribute(PortalReservedParameters.PREFERED_CHARACTERENCODING_ATTRIBUTE);
             boolean decode = getRequest().getAttribute(PortalReservedParameters.PARAMETER_ALREADY_DECODED_ATTRIBUTE)
== null
-                    && getCharacterEncoding() != null;
+                    && encoding != null;
             if (decode)
             {
                 getRequest().setAttribute(PortalReservedParameters.PARAMETER_ALREADY_DECODED_ATTRIBUTE,
@@ -165,7 +166,7 @@
                     {
                         try
                         {
-                            paramValues[i] = new String(paramValues[i].getBytes("ISO-8859-1"),
getCharacterEncoding());
+                            paramValues[i] = new String(paramValues[i].getBytes("ISO-8859-1"),
encoding);
                         }
                         catch (UnsupportedEncodingException e)
                         {
@@ -528,4 +529,4 @@
     {
     }
 
-}
\ No newline at end of file
+}



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


Mime
View raw message