css檔案放在WebContent下,沒有放在WEB-INF路徑下
在jsp中引入如下
運作jsp時css中設定的樣式就是沒有效果,糾結了一上午,終于發現,在spring mvc預設攔截所有請求,是以你需要單獨把靜态資源配起來,springmvc就會放過這些請求了。格式:<mvc:resources location="/public-resources/" mapping="/resources/**"/>
是以在springmvc-servlet.xml中:
<mvc:resources location="/css/" mapping="/css/**"></mvc:resources>
學習筆記