tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: AW: specifying the content-type
Date Mon, 06 Jun 2011 13:58:43 GMT
Hash: SHA1


On 6/2/2011 4:02 PM, André Warnier wrote:
> As others already mentioned, setting the proper header at the Tomcat
> webapp level would be the best solution (and a "clean" application
> should do that anyway).


The lack of a header being set by the webapp is what triggers this
seemingly-strange behavior. For whatever reason, httpd wants to send a
content-type and makes the default (text/plain) explicit for you if none
is present.

With no content-type, most clients will do whatever they think makes
sense, which is usually an auto-detect. Since the page actually contains
HTML markup, the browser makes an educated guess.

The "source" view of the page is simply the client doing exactly what
it's been told to do :)

I'll bet MSIE will work no matter what, because it tends to ignore the
Content-Type header and use it's "best" "judgment" all the time. I
haven't checked to see if MSIE9 or MSIE10 have stopped doing that.
(MSIE9 really turned out to be a great browser, honestly.)

> Trying to set the header at the Apache httpd level is not so clean,


- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message