Spring MVC での css ファイルの処理に問題があります。css ファイルの場所とマッピングに問題があります。
css ファイルが次の場所にある場合:
-src
-main
+java
+resources
-webapp
-css
style.css
+WEB-INF
(Maven プロジェクト)
私が使う:
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:annotation-driven/>
でdispatcher-servlet.xml
、次のようにアクセスしてアクセスしますjsp
。
<head>
<title>Insert title here</title>
<link href="/css/style.css" rel="stylesheet" type="text/css">
</head>