2

I'm developing a jsp page webapp with Eclipse and I run it on Tomcat 7.

In the jsp page I put this css tag:

<link href="../css/new_style.css" rel="stylesheet" type="text/css"/>

However when I contact via browser such jsp page the css is NOT loaded and I found that the reason is:

Resource interpreted as Stylesheet but transferred with MIME type text/plain.

What should I modify?

1 Answers1

0

When you ask for your stylesheet, your server is telling the browser that it is an TEXT document (Content-Type: text/plain) instead of a stylesheet (Content-Type: text/css).

please add the meta tags to your jsp,

<meta http-equiv = "Content-Language" content = "en"/>
<meta http-equiv = "Content-Type" content="text/html; charset=utf-8">

if you are using it in the jsp tags,

<%@ page contentType="text/html;charset=utf-8" %>

Use the Net tab of your browser's developer tools to examine the request and the response.

And read this Chrome says "Resource interpreted as script but transferred with MIME type text/plain.", what gives?

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56
  • I added in the jsp all the three tags you suggested and I also added to the web.xml but to no avail this: css text/css and of course I restarted Tomcat... –  Nov 06 '14 at 08:40