Tomcat is giving the wrong MIME type?

L

lvterry

I use Tomcat serves a web application. I put all the files including
jsp, css and javascript file inside the Tomcat server.
When I request a jsp page through both Firefox1.5 and IE6, I found the
css and the javascript files are not loaded correctly.
I used LiveHttpHeaders to inspect the request and response headers. I
found that the server is giving text/html to the Content-Type of all
the files.
Is the problem in Tomcat configuration or in the browser?
Any idea?
TIA...
 
J

Juha Laiho

(e-mail address removed) said:
I use Tomcat serves a web application. I put all the files including
jsp, css and javascript file inside the Tomcat server.
When I request a jsp page through both Firefox1.5 and IE6, I found the
css and the javascript files are not loaded correctly.
I used LiveHttpHeaders to inspect the request and response headers. I
found that the server is giving text/html to the Content-Type of all
the files.
Is the problem in Tomcat configuration or in the browser?

Looks like your version (or installation) of Tomcat doesn't have the
configurations for .js and .css file types. You can add them to
the WEB-INF/web.xml file (see the Servlet Specification for details;
mime-mapping is the element you're looking for).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top