users@glassfish.java.net

Re: Can't set charset to UTF-8

From: Gerald Holl <gerald_at_holl.co.at>
Date: Tue, 13 Nov 2007 08:54:46 +0100

Ryan Lubke wrote:
> Gerald Holl wrote:
>> Ryan Lubke wrote:
>>>> It's 3 times in the log, 2 times before the warning and once after.
>>>>
>>> Can you post the other two?
>>
>> Here it is. It's more than 3 times in the log, I didn't see it first.
> Ok, looking through the source for the different filters A4J leverages,
> it would seem that based off the stacktrace, A4J will set the request
> encoding,
> and further in the filter processing calls ServletRequest.getParameter()
> which
> effectively locks the encoding and causes the warning to be displayed when
> an attempt is made to set it again (as is done by default in
> ViewHandler.initView().

I debugged the character encoding stuff in a4j and it complains that the
request has a content-type without character encoding:

[#|2007-11-13T08:51:02.847+0100|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=36;_ThreadName=httpSSLWorkerThread-8181-23;|2007-11-13
08:51:02,847 DEBUG BaseFilter:205 - Incoming request has Content-Type
header without character encoding: application/x-www-form-urlencoded