tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: POST data (single character) cleared when using tomcat 6.0.33 and Character Encoding Filter
Date Mon, 16 Jan 2012 02:18:43 GMT
2012/1/16 kitagawa <kitagawaworks@gmail.com>:
> Hi, I'm new to this but please direct me if I'm posting to the wrong list.
>
> While developing using ubuntu 11.04, tomcat 6.0.33 and java 1.5 I ran
> into a problem after setting the character encoding filter for
> requests.
> When posting a request, the value of any field with only a single
> character submitted is cleared.
>
> I also tested this issue with:
> tomcat 6.0.32 and java 1.5 (no problem)
> tomcat 6.0.35 and java 1.5 (same error occured)
> tomcat 6.0.33 and java 1.6 (no problem)
> tomcat 6.0.35 and java 1.6 (no problem)
>
>
> This can be repeated using the RequestParamExample that comes with tomcat.
>
> 1. uncomment the "Set Character Encoding" line in
> apache-tomcat-6.0.33\webapps\examples\WEB-INF\web.xml (lines 88 and
> 93)
> 2. start tomcat
> 3. go to http://localhost:8080/examples/servlets/servlet/RequestParamExample
> and enter a single character into the first or last name fields then
> post.
>
> The entered value does not show up. Instead, the value shows up blank.
>  If I enter two characters they appear correctly.
>
> I searched online for a solution but only came up with the following
> from tomcat bugzilla
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51773
>
> Does anyone know a solution to this problem?

It is in the FAQ:
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

In short: enabling the filter makes Tomcat expect that the data (sent
by web browser) use certain character encoding.

But the web browser does not know that you configured the filter. See
FAQ for how to do it properly.

Best regards,
Konstantin Kolinko

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


Mime
View raw message