Re: JSP page directive contentType overriden by Apache tomcat?

Jungshik Shin wrote:

I'm sorry I forgot to mention that I use Tomcat 4.1.30 on Mac OS X with 
Java 1.4.2 (the latest
available for Mac OS 10.3.x)

>
>
>
> Following the standard-step of adding contentType and pageEncoding 
> directives at the beginning
> of jsp files (I also added request.setCharacterEncoding("UTF-8"); 
> along with making sure that
> that's honored because recent versions of Apache tomcat by default 
> ignores that for GET),
> I expected everything to work. To my great surprise, all the JSP files 
> with
> 'contentType="text/html; charset=UTF-8"' directive still emit 
> 'Content-Type:text/html; charset=ISO-8859-1'
> in HTTP header. Even more surprsing is that cached versions of 
> translated java source files for
> those jsp files have the following line:
>
> response.setContenttype("text/html; charset=UTF-8");
>
> It's completely beyond me how I've been getting  'text/html; 
> charset=ISO-8859-1' despite that.
> e.
>
Even more strange is that everything works perfectly when I connect with 
Safari (locally - http://localhost:8080/.....) while on the same host 
Mozilla does have a problem. So does
a remote Mozilla and MS IE.  Is there any built-in 'charset' negotiation 
mechanism in
Tomcat (or JSP container in general)?

Jungshik

Received on Friday, 16 July 2004 17:40:38 UTC