users@glassfish.java.net

Re: encoding still not working :(

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 24 Mar 2009 19:50:55 -0700

BJörn,

can you send me your app so I can take a look?

Thanks,

Jan

On 03/23/09 06:04 AM, BJörn Lindqvist wrote:
> 2009/3/19 Jan Luehe <Jan.Luehe_at_sun.com>:
>
>> The solution, which forces the browser to submit forms in UTF-8, is to
>> use the following jsp tag:
>>
>> <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
>>
>>
>> Exactly!
>>
>> It would be more convenient if there was a domain setting to set the
>> default HTTP Content-Type header to UTF-8, but there doesn't seem to
>> be any.
>>
>>
>> Correct, there is no domain setting for this, because each webapp is
>> different.
>> However, you could declare the above page directive in a JSP prelude (which
>> in
>> turn would have to be declared in your web.xml), in order to avoid having to
>> declare it on each and every of your JSPs.
>>
>
> I tried this, and it should work correctly, except that that config
> easily conflicts with the pageEncoding attribute on individual pages.
> For example, if you configure the encoding to be "UTF-8" in web.xml,
> and then also have pageEncoding="utf-8" in JSP headers, then glassfish
> flips out because "UTF-8" != "utf-8" and thinks that they declare
> different encodings. It is totally braindead and a bug in glassfish.
>
>
>