MIME type text/html

Hi I'm working on a project and try to add css to a page but its not loading and when i check srourcecode at the browser I get a :

Resource interpreted as Stylesheet but transferred with MIME type text/html:

I tried to load css in every way, with - " rel="stylesheet"> - - even with @import file ( not a best practice but i tried...)

and its not working.

Files: Project:

-WebContent

   -resources
       - css
           -main.css
   -WEB-INF-

  -MTEA-INF

Web.xml:

<?xml version="1.0" encoding="UTF-8"?>

http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">

<!-- The front controller of this Spring Web application, responsible for 
    handling all application requests -->
<servlet>
    <servlet-name>springapp</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/springapp-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
    <servlet-name>springapp</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

dispatcher-servlet.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

<context:component-scan base-package="com.drs.controller" />

<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="resources/" />


<bean id="viewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass"
        value="org.springframework.web.servlet.view.JstlView"></property>
    <property name="prefix" value="/WEB-INF/jsp/"></property>
    <property name="suffix" value=".jsp"></property>
</bean>

Anyone have an ideea?How to solve this?

链接地址: http://www.djcxy.com/p/47018.html

上一篇: 无法在ASP.NET中呈现css

下一篇: MIME类型text / html