读书人

spring-beans-2.5.xsd不识别的解决办法

发布时间: 2013-08-04 18:26:16 作者: rapoo

spring-beans-2.5.xsd不识别的解决方法

学习笔记,转自:http://blog.sina.com.cn/s/blog_5002ee3d0100non0.html

?

无联网情况下如何让MyEclipse 识别 spring-beans-2.5.xsd 文件
手动添加 schema文件,方法如下:
使用myeclipse开发spring,在编写配置文件的时候可能遇到无法使用帮助,来自动添加xml元素的问题,是因为无法查找spring的DTD描述。这里做个记录手工添加DTD的方法
window--》preferences--》MyEclipse--》Files and Editors--》XML--》XML Catalog
?
1)点击ADD
2)Key Type:选择URL
在location中选择FileSystem然后在spring的解压目录的dist/resources目录中选择spring-bean-2.5.xsd
?? Location:点击浏览--》找到spring源码包--》dist --》resources --》
???????????? spring-beans-2.X.xsd(根据你使用的spring版本决定)
???????????? 将? 它的完整路径\spring-beans-2.X.xsd 填写到location一栏中
3)此时修改Key Type 为Schema Lcation
4)Key :在给出的字符串后添加 -->? /spring-beans-2.X.xsd
5)重新打开配置文件测试一下
?
?
其中key值应该和applicationContext.xml中的
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.X.xsd">对应上。

读书人网 >编程

热点推荐