一.解决
1.在spring-mvc.xml中配置(控制层)
<!--视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp"/><!--前缀-->
<property name="suffix" value=".jsp"/><!--后缀-->
<!-- 引入静态资源 -->
<mvc:resources mapping="/css/**" location="/css/**" />
<mvc:resources mapping="/bootstrap/**" location="/bootstrap/**" />
<mvc:resources mapping="/fonts/**" location="/fonts/**" />
<mvc:resources mapping="/img/**" location="/img/**" />
<mvc:resources mapping="/jquery/**" location="/jquery/**" />
<mvc:resources mapping="/script/**" location="/script/**" />
<mvc:resources mapping="/fonts/**" location="/fonts/**" />
</bean>
2.在web.xml中配置
<!-- 静态资源 -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
<url-pattern>*.js</url-pattern>
<url-pattern>*.gif</url-pattern>
<url-pattern>*.png</url-pattern>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
标签:xml,渲染,default,maven,css,png
From: https://www.cnblogs.com/cony1/p/16949242.html