tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: jsp page on Tomcat non loading css
Date Sat, 08 Nov 2014 13:31:18 GMT
2014-11-06 14:04 GMT+03:00 Alessandro Panzeri <alessandro.panzeri88@gmail.com>:
> I deployed a war on Tomcat 7 to serve a jsp page.
>
> In the jsp page I put this css tag:
>
> <link href="../css/new_style.css" rel="stylesheet" type="text/css"/>
>
> Also, at the beginning of the jsp page I put this:
>
> <%@ page contentType="text/html;charset=utf-8" %>
>
> However when I contact via browser such jsp page, the css is NOT loaded and
> I found that the reason is (returned by Google Chrome inspecting the page):
>
> "Resource interpreted as Stylesheet but transferred with MIME type
> text/plain."
>
> I can't figure out what to modify...any advice?

It means that server accompanies your CSS file with HTTP protocol
header "Content-Type: text/plain" while the browser expects it to be
"Content-Type: text/css".

The contents of your JSP page and your <link> tag are irrelevant. You
cannot solve this by modifying your JSP or CSS files.

The mime type for static files is usually configured by <mime-mapping>
elements in your web.xml.  Either you have those wrong, or your CSS is
not a static file, or something else modifies your Content-Type header
(e.g. a Filter).

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


Mime
View raw message