在配置spring - mvc 的时候,有针对resource资源的配置
<!-- http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources -->
<mvc:resources mapping="/static/**" location="/static/" />
该配置的xml命名空间为:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
但是eclipse 在 <mvc:resources mapping="/static/**" location="/static/" /> 这行中总是报错,提示:
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for
element 'mvc:resources'.
问题小,但是工程有个错误提示总是不爽,具体解决如下:
1. 打开 windows -> preference , 弹出对话框
2. 在该dialog中左上角的 "type filter text" 中,输入 "xml c"关键字,会跳到"XML Catalog"目录。
3. 在 XML Catalog Entries中找到 "Plugin Specified Entries" 。
4. 拖动滚动条到下方,找到 "http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd" 项
5. 点击该项,在下面的 "Details" 会有相关详情:类似
Location: /**/Genuitec/MyEclipse-8.6/configuration/org.eclipse.osgi/bundles/1070/1/.cp/org/springframework/web/servlet/config/spring-mvc-3.0.xsd
URI: file:/**/Genuitec/MyEclipse-8.6/configuration/org.eclipse.osgi/bundles/1070/1/.cp/org/springframework/web/servlet/config/spring-mvc-3.0.xsd
Key Type: Namespace Name
Key: http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
6. 访问"http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd",下载该文件,替换 Location 对应的文件(保险起见,建议备份该文件)
7. 重新build 工程,错误提示就被哈皮的去掉了~~
分享到:
相关推荐
解决 MyEclipse 10.X 导出EAR WAR报错问题 , 将原文件解压重组上传..同时将Price降低
myeclipse10系列导出war包报错的解决方案
myEclipse2013+spring-mvc+mybatis3.2.2实现增删改查简单完整版,可在myEclipse2013自带的Tomcat 7上运行,weblogic上可能有问题,有ModelMap 和ModelAndView的简单使用比较,ModelMap用起来更方便简洁。也使用到了c...
myeclipse导包war报错解决方案 ,希望对大家有帮助
第3篇是Spring MVC技术入门,包括Spring MVC的背景介绍、架构整体剖析、环境搭建、处理器与映射器的讲解、前端控制器的源码分析、多种视图解析器的介绍、请求映射与参数绑定的介绍、Validation校验与异常处理和拦截...
解决myeclipse10.1导出War包出错:Security Alert:Integrity check error 解决myeclipse10.1不能导出war包报错
MyEclipse手动添加Spring支持
MyEclipse8.5+Spring3.0MVC+Hibernate3.3+Mysql样例 详细讲述如何配置开发环境,如何创建样例工程,配置文件如何配置,各个配置项的意义等。 步骤详细,代码完整,方便初学者快速掌握整套开发技术,缩减学习成本。
在myeclipse10+spring mvc+ibatiS搭建的一个demo。后台数据库使用mysql,表参见实体类建立
使用环境:MyEclipse/Eclipse + Tomcat + MySQL。 使用技术:Spring MVC + Spring + MyBatis / JSP + Servlet + JavaBean + JDBC。
我们现在一般网站都是利用的MySQL数据库搭建网站的,但是在网上看到很多网友吐槽数据库连接不上的问题,现在我就结合相关资料向提出一些我个人的见解,希望对大家解决问题有帮助。 一般MySQL连接不上,可能有两大...
基于spring mvc、spring、hibernate、bootstrap、maen开发的企业级项目,导入即可运行
使用环境: MyEclipse/Eclipse + Tomcat + MySQL。...使用技术: Spring MVC + Spring + MyBatis 或 JSP + Servlet + JavaBean + JDBC。 效果:https://ymjin.blog.csdn.net/article/details/119986708
破解完MyEclipse10.1版本后,导出war文件时,报SECURITY ALERT: INTEGRITY CHECK ERROR的错误,解决办法在压缩文件内。
使用myeclipse8.6ForSpring封装的注册机工具,直接java -jar 后输入一个注册名即可。
解决MyEclipse导出war包时报“SECURITY ALERT: INTEGERITY CHECK ERROR”的错误 使用方法参考:https://blog.csdn.net/qq_37131111/article/details/84582925
myeclipse运行太慢。如何提高速度呢? 1 、关闭MyEclipse的自动validation windows > perferences > ... 在需要验证的文件上( 右键 -> MyEclipse -> Run Validation 。 2、 启动优化,关闭不需要使用的模块......
简单的springMVC架构例子
在myeclipse自动提示spring的配置信息
MyEclipse开发基于MVC 模式的WEB应用实例讲解