J2EE for SpringMVC 映射静态资源独Js不成功的问题解决
来源:互联网 发布:九阴绝学玄兵进阶数据 编辑:程序博客网 时间:2024/06/03 17:31
刚才博主遇到一个很头大的问题,静态资源映射了,路径语法啥的都没问题而css和img又能够映射成功,能够正常读取,经过反复检查,博主发现是版本跟不上了。
看看博主的配置先:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--本项目把静态资源放在了WEB-INF的statics目录下,资源映射如下--> <mvc:resources mapping="/css/**" location="/WEB-INF/statics/css/"/> <mvc:resources mapping="/js/**" location="/WEB-INF/statics/js/"/> <mvc:resources mapping="/img/**" location="/WEB-INF/statics/img/"/>
问题就处在了schema:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
这样写就没问题了。
关键:
http://www.springframework.org/schema/mvc/spring-mvc.xsd和http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
只需要加上-3.0就ok了!
阅读全文
1 0
- J2EE for SpringMVC 映射静态资源独Js不成功的问题解决
- 关于springmvc的静态资源映射问题
- SpringMVC静态资源映射配置
- J2EE for Spring MVC注解的方式把对象转换成json不成功的问题解决
- springMVC 引入静态资源Js的方式
- 第十六章 SpringMVC静态资源映射
- springMVC静态资源路径问题解决办法
- Springmvc框架静态资源访问404问题解决
- 解决springmvc请求丢失js等静态资源的方法
- SpringMVC加载web下的静态资源:css、js
- J2EE for SpringMvc 中JSP在idea里不能够提示Bootstrap的问题解决
- 【配置DATAGUARD 时的监听静态注册不成功】 问题解决
- SpringMVC的静态资源拦截
- SpringMVC在做静态资源映射的时候需要注意的问题
- springMVC(13)------springMVC静态资源的访问
- SpringMVC静态资源,页面映射,attribute范围,ModelAttribute
- spring-MVC添加静态资源的映射
- springmvc资源映射配置
- 关于xml的一些见解
- CheckBox反选
- SpringMVC学习系列(7) 之 格式化显示
- 模拟实现C库里的itoa()函数和atoi()函数
- spring boot test的简单使用
- J2EE for SpringMVC 映射静态资源独Js不成功的问题解决
- linux部署tomcat8.5
- 【STL】实现简单的空间配置器
- 并发学习->《Java并发编程的艺术》->重点摘录总结
- 练习6
- WaitForEndOfFrame
- C语言实现图的关键路径算法
- Hdu 6090 Rikka with Graph【贪心】
- linux面试题