users@glassfish.java.net

Re: Can't set charset to UTF-8

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 14 Nov 2007 09:50:05 -0800

Gerald Holl wrote:
> Ryan Lubke wrote:
>
>> I'm guessing it's this snippet in Woodstock's UploadFilter (present in
>> the most recent set of stacktraces):
>>
>> if (!FileUpload.isMultipartContent(req)) {
>> chain.doFilter(request, response);
>> return;
>> }
>>
>> If the request isn't multipart/form-data, the UploadFilter invokes the
>> filter chain.
>> If it is, then further in the processing setRequestEncoding is called.
>>
>
> I took a look at the woodstock UploadFilter source and the character
> encoding is set to UTF-8 if request.getCharacterEncoding() returns null.
> So I don't understand why the characters are broken.
>
If the content type can't be determined from the request,
getContentType() will be null.
The reason you get this message printed to the log is because the filter
sets the the character encoding
and then obtains query parameters (doing this effectively locks the
encoding for the duration of the request). Later in the request
processing, the JSF lifecycle will set the character encoding when
initializing the view and this triggers the warning.

I wouldn't characterize anything here as broken per se. This message is
informational (perhaps it's too verbose).
That said, I'll look into a modification in the JSF api and see if the
warning can be eliminated.

> Gerald
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>