Author: hlship
Date: Sat Jun 23 18:13:41 2007
New Revision: 550148

URL: http://svn.apache.org/viewvc?view=rev&rev=550148
Log:
TAPESTRY-1294: Tapestry does not set an output encoding which prevents Unicode 
content from being output correctly

Modified:
    
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/MultipartDecoderImpl.java
    
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/ParametersServletRequestWrapper.java

Modified: 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/MultipartDecoderImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/MultipartDecoderImpl.java?view=diff&rev=550148&r1=550147&r2=550148
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/MultipartDecoderImpl.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/MultipartDecoderImpl.java
 Sat Jun 23 18:13:41 2007
@@ -40,11 +40,12 @@
 
     private final int _repositoryThreshold;
 
-    private final long _maxRequestSize ;
+    private final long _maxRequestSize;
 
     private final long _maxFileSize;
 
-    public MultipartDecoderImpl(String repositoryLocation, int 
repositoryThreshold, long maxRequestSize, long maxFileSize)
+    public MultipartDecoderImpl(String repositoryLocation, int 
repositoryThreshold,
+            long maxRequestSize, long maxFileSize)
     {
         _repositoryLocation = repositoryLocation;
         _repositoryThreshold = repositoryThreshold;
@@ -61,6 +62,7 @@
     {
         // String encoding = request.getCharacterEncoding();
         List<FileItem> fileItems = parseRequest(request);
+
         return processFileItems(request, fileItems);
     }
 

Modified: 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/ParametersServletRequestWrapper.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/ParametersServletRequestWrapper.java?view=diff&rev=550148&r1=550147&r2=550148
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/ParametersServletRequestWrapper.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/services/ParametersServletRequestWrapper.java
 Sat Jun 23 18:13:41 2007
@@ -16,6 +16,7 @@
 
 import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
 
+import java.io.UnsupportedEncodingException;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Map;
@@ -23,6 +24,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 
+import org.apache.tapestry.services.Dispatcher;
+
 /**
  * Wrapper for HttpServletRequest that overrides the parameter methods of the 
wrapped request. i.e.
  * parameters are retreived from the wrapper rather than the real request.
@@ -84,5 +87,17 @@
         ParameterValue value = _parameters.get(name);
 
         return value == null ? ParameterValue.NULL : value;
+    }
+
+    /**
+     * Ignores any attempt to set the character encoding. Tapestry attempts to 
set the encoding
+     * <em>after</em> the page name has been identified by the correct [EMAIL 
PROTECTED] Dispatcher}, and
+     * that's too late from the perspective of the Servlet API as 
HttpServlet.getInputStream() will
+     * already have been called.
+     */
+    @Override
+    public void setCharacterEncoding(String enc) throws 
UnsupportedEncodingException
+    {
+
     }
 }


Reply via email to