You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yoshikazu Kuramochi <yo...@kuramo.ch> on 2008/01/18 16:19:29 UTC

Utf8Filter needs implementing HttpServletRequestFilter instead of RequestFilter when uploading file.

Hi,

Utf8Filter (http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding)
does not work properly when uploading file.

MultipartServletRequestFilter is executed before Utf8Filter,
so request.getCharacterEncoding() returns null in MultipartDecoderImpl
and default character encoding is used to decode field values on  
T5.0.8-SNAPSHOT
(on T5.0.7, NullPointerException is thrown).


I resolved as follows:

   * Utf8Filter implements HttpServletRequestFilter instead of  
RequestFilter.
   * Add the filter before MultipartFilter.

     public static void contributeHttpServletRequestHandler(
             OrderedConfiguration<HttpServletRequestFilter>  
configuration,
             @InjectService("Utf8Filter") HttpServletRequestFilter  
utf8Filter)
     {
         configuration.add("Utf8Filter", utf8Filter,  
"before:MultipartFilter");
     }


Is this appropriate?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org