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/04/10 17:26:43 UTC

DO NOT REPLY [Bug 18902] New: - 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

           Summary: Content Type set to "text/plain" when none explicitly
                    assigned in the servlet
           Product: Tomcat 4
           Version: 4.1.24
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Connector:Coyote HTTP/1.1
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: kyiv@hotmail.com


The problem is that the new version of Tomcat (v4.1.18 or v4.1.24) 
assigns "text/plain" content type to the response that is coming from a servlet 
unless it was explicitly assigned within the servlet.  

I think the change happened when Tomcat switched from HTTP/1.1 connector to 
Coyote.  
Tomcat 4.0.2 (and prior) doesn't supply any content type if none was explicitly 
specified, and Tomcat 4.1.18 (and later, I didn't test versions in between) 
sets it to "text/plain".

Because a browser is not supposed to guess for content type if it's specified 
explicitly in the header (according to HTTP/1.1 spec), Netscape displays the 
page that was generated by a servlet (by including a JSP) as a text if the 
content type wasn't set to "text/html" in the servlet.

And again, the older version of Tomcat (v4.0.x) did not assigned content type, 
if none was set in the servlet, and any browser was able to recognize it based 
on the HTML tags.

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