springmvc静态样式文件404

来源:互联网 发布:电脑网络电缆测试仪 编辑:程序博客网 时间:2024/06/06 03:10
在springmvc的配置文件中添加以下scame

xmlns:mvc="http://www.springframework.org/schema/mvc" 

xsi:schemaLocation="http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"

并且添加以下映射来对应你前台的请求资源文件,需要与实际路径相对应
<!-- 用来解决js文件以及样式不能正常引用问题 -->
 <mvc:resources location="/WEB-INF/images/" mapping="/images/**" />  
 <mvc:resources location="/WEB-INF/css/" mapping="/css/**" />  
 <mvc:resources location="/WEB-INF/js/" mapping="/js/**" />  
0 0
原创粉丝点击