失效的原因,我当时的配置方法如下:
Spring的配置:
<mvc:resources mapping="/img/**" location="/WEB-INF/pages/img/"/> <mvc:resources mapping="/css/**" location="/WEB-INF/pages/css/"/> <mvc:resources mapping="/fonts/**" location="/WEB-INF/pages/fonts/"/> <mvc:resources mapping="/js/**" location="/WEB-INF/pages/js/"/>
相应的资源放到其对应目录结构下
修改后的配置如下:
<mvc:resources mapping="/img/**" location="/img/"/> <mvc:resources mapping="/css/**" location="/css/"/> <mvc:resources mapping="/fonts/**" location="/fonts/"/> <mvc:resources mapping="/js/**" location="/js/"/>相应的资源放到其对应目录结构下,而且,即使不在spring中配置资源路径也不会出现问题。