You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/07/23 18:42:02 UTC

DO NOT REPLY [Bug 18902] - Content Type set to "text/plain" when none explicitly assigned in the servlet

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18902>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18902

Content Type set to "text/plain" when none explicitly assigned in the servlet





------- Additional Comments From jenny@bigbrother.net  2003-07-23 16:42 -------
Symptoms
Servlets which do not set a content type header inherit "text/plain" even 
though the web server 
itself is set to DefaultType text/html - no amount of web server configuration 
affects it. The bug 
comes from the Coyote connector for Tomcat, since Tomcat version 4.1 (and still 
present by 
some versions of 5.0, according to info on the web).

Tomcat Coyote is setting text/plain when it probably should have left it null, 
or at least set text/html.
You can patch coyote to send html instead of plain, as follows:



Patch (This is probably not the best solution, but rather a workaround.)

Download the source for the connectors, and try to have available the 
dependencies it needs.
(Watch the list of jar properties that shows when you run ant, and make sure 
most/all get set.)

Then edit:
jakarta-tomcat-connectors-4.1.24-
src/coyote/src/java/org/apache/coyote/Constants.java:

public static final String DEFAULT_CONTENT_TYPE = "text/plain";

Modify to say text/html instead.  Then run ant in the top level dir and compile 
it all.  Make sure 
your compilation doesn't have errors.  

Make a backup copy of /usr/local/tomcat/server/lib/tomcat-coyote.jar in case 
your new one doesn't work.
Then copy coyote/build/lib/tomcat-coyote.jar into the system-wide tomcat 
server/lib/ directory.
Restart tomcat and test it out.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org