users@glassfish.java.net

Can't set charset to UTF-8

From: Gerald Holl <gerald_at_holl.co.at>
Date: Wed, 07 Nov 2007 16:01:07 +0100

Hello,

I'm having troubles setting the charset to UTF-8 on Glassfish:
[#|2007-11-07T14:38:01.059+0100|WARNING|sun-appserver9.1|org.apache.coyote.tomcat5.CoyoteRequest|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=aa139129-bed8-45a9-adb5-d099637fcdf8;|PWC4011:
Unable to set request character encoding to ISO-8859-1 from context
/myapp, because request parameters have already been read, or
ServletRequest.getReader() has already been called|#]

I'm confused why the server complains about the ISO-8859-1 character
encoding.

In Firefox, the character encoding is set to ISO-8859-1 instead of UTF-8
(Menu View, Character Encoding).

I tried to set a hint in sun-web.xml:
<locale-charset-info>
   <parameter-encoding default-charset="UTF-8" form-hint-field="UTF-8" />
</locale-charset-info>

The warnings are still in the server.log

How do I set the charset to UTF-8?


cheers,
Gerald