You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Vermeulen, Francis" <Fr...@atosorigin.com> on 2003/01/22 17:07:59 UTC

request.setCharacterEncoding(charset) problem? - The solution!

Hi,

this is a continuation of my earlier mail concerning the ineffectiveness of
the request.setCharacterEncoding(charset) method on my development platform.
I've found the cause of this and it is something worth noting if you plan to
develop internationalized JSP's or servlets.

It turns out that I changed the logging verbosity level of Jasper (in the
conf/web.xml file), setting it to DEBUG for debugging puposes.

This causes Jasper to print out the request parameters by calling
request.getParameter() for each parameter in the POST, without setting any
charset... And yes, the getParameter(0 method of HttpRequestBase checks to
see if it has been called already and returns the existing parameter map. So
when my JSP page calls request.getParameter() it receives the result of the
first call (by Jasper) so that the call to
request.setCharacterEncoding(charset) has no effect since the decoding is
not repeated at this point! If I change Jasper's logging level to ERROR,
everything works fine as the getParameter() is called the first time from my
JSP page only.

This definitely is a bug as far as I'm concerned, since setting DEBUG level
should not influence the behaviour of the software, agree?

Regards,

============================================
Ing. FRA Vermeulen
Senior J2EE Architect
ECM Solutions - Eindhoven
mobiel: +31 (0) 6 222 03 856
e-mail: francis.vermeulen@atosorigin.com
============================================



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>