Why Tomcat always return "text/html;"? [closed]
Tomcat always returns http header Content-Type as "text/html;charset=ISO-8859-1"
, if I set it in my JSP page via 'response.setContentType("application/xml")'
or <%@page contentType="application/xml" %>
still same. I use Tomcat 7.0.5, but it also occurs in Tomcat 6 and 5?
You've to define some content type, not an empty one. If it's supposed to be generic text/plain content, then do so:
<%@page contentType="text/plain" %>
You can find an overview of most common content types here.
Check you're setting the content type before sending any output.
精彩评论