springmvc 无法访问静态资源

没有配置<mvc:resources location="/" mapping="/**"/>
<?xml version="1.0" encoding="UTF-8"?>
<!-- 必须有带mvc的 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context.xsd">




<context:component-scan base-package="priv.lirenhe.js.*"></context:component-scan>
<mvc:annotation-driven />
<mvc:resources location="/" mapping="/**"/>
<bean id="modelAndView" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<constructor-arg name="prefix" value="/WEB-INF/jsp/"/>
<constructor-arg name="suffix" value=".jsp"/>
</bean>



</beans>
原文地址:https://www.cnblogs.com/lirenhe/p/9774461.html