동적 웹 프로젝트에 문제가 있습니다. 교축은
"리소스가 스타일 시트로 해석되었지만 MIME 유형이 text/html로 전송 됨"Java 웹 프로젝트 발행
WebContent
|
|
부트 스트랩
CSS를
JS
WEB-INF
|
|
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-theme.css"/>
<link rel="stylesheet" type="text/css" href="css/connection.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/register.js"> </script>
<title>Jweb</title>
</head>
<body>
모든 CSS가 적용되지 않으며, 크롬의 콘솔에서 나는이있다 : connection.jsp
그런 다음 connection.jsp에 나는이 만들
Resource interpreted as Stylesheet but transferred with MIME type text/html:
"http://localhost:8080/jweb/bootstrap/css/bootstrap-theme.css". localhost/:10
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/jweb/bootstrap/css/bootstrap.css". localhost/:9
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/jweb/css/footer.css". localhost/:11
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/jweb/css/header.css". localhost/:12
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/jweb/js/jquery.js". localhost/:14
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/jweb/js/bootstrap.js". localhost/:15
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/jweb/css/connection.css".
웹. xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<include-prelude>/WEB-INF/taglibs.jsp</include-prelude>
</jsp-property-group>
</jsp-config>
</web-app>
나는 2 일 전에이 문제를 해결하려고 노력하지만 여전히 그 위에. 해결할 수 있습니까?
<mime-mapping>
<extension>css</extension>
<mime-type>text/css</mime-type>
</mime-mapping>
일예 :
그래도이 설정을 어디에서해야하나요? 나는 콘텐츠 유형이 "text/css"로 설정되었지만 작동하지 않는 을 추가하려고했습니다. 내 서블릿에 콘텐츠 형식 속성을 설정하려고했습니다. 그리고 그것을 해결하는 다른 방법 (인터넷에있는 모든 해결책)이 있지만 아무도 작동하지 않습니다. –
웹 서버 설명서를 참조하십시오. 그것은 서버 소프트웨어에 따라 다릅니다. –
서버 유형 (tomcat, glassfish, jboss) 및 게시 web.xml –