tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jess Holle <je...@ptc.com>
Subject Re: RequestDumperValve screws UTF-8 parameter parsing
Date Tue, 10 Jan 2006 11:51:47 GMT
Endre Stølsvik wrote:

>On Tue, 10 Jan 2006, Oded Arbel wrote:
>
>| On Tuesday, 10 ÿÿJanuary 2006 00:06, Endre Stølsvik wrote:
>| > Enabling the RequestDumperValve in both 5.5.12 and 5.0.16 (!) messes
>| > up the parsing of other-than-ISO-8859-1 incoming parameters.
>| >
>| > After using a rather huge bunch of hours, this came down as the
>| > result: when this "debug valve" is turned on, it seems to default to
>| > ISO-8859-1 when it parses and log-outputs the incoming parameters,
>| > thus also implicitly setting the entire Request-object to this enc,
>| > so any subsequnt setting to UTF-8 doesn't matter at all. At least
>| > this is true for POST paramters.
>| 
>| AFAIK, the catalina implementation of HttpServletRequest does not allow 
>| to set the character set more then once, even though it doesn't do any 
>| pre-processing of the input.
>| 
>| Maybe that should be fixed instead ?
>
>I think that when you "touch" the servlet request object's parameters at 
>all (or even anything else it might seem like), it parses them all at once 
>using the then-set (or default) encoding and caches them.
>
>This is most probably according to spec.
>  
>
This is most definitely according to the spec.

Then again, valves are below the level of the spec and could do things 
differently.  The  point is that this would be difficult to do 
efficiently at request start and so tradeoffs were clearly made.  This 
may not have been documented right at first (I know I got burned once), 
but the issue has always clearly been there.  I'd suggest living with it 
or writing your own filter.  Doing such output at request end works and 
while I don't think such a filter can provide everything a valve can it 
does allow an awful lot of information to be gathered.

--
Jess Holle

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


Mime
View raw message