SSM博客 前端页面样式不显示


<!-- 由于在web.xml中定义的url拦截形式为“/”表示拦截所有的url请求,
包括静态资源例如css、js等。所以需要在springmvc.xml中添加资源映射标 -->

<mvc:resources location="/WEB-INF/js/" mapping="/js/**"/>
<mvc:resources location="/WEB-INF/css/" mapping="/css/**"/>
<mvc:resources location="/WEB-INF/fonts/" mapping="/fonts/**"/>
<mvc:resources location="/WEB-INF/images/" mapping="/images/**"/>

需要在spring-mvc.xml里面单独配置静态资源路径
原文地址:https://www.cnblogs.com/alexhere/p/7156345.html