使用myeclipse开发spring,在编写配置文件的时候可能遇到无法使用帮助,来自动添加xml元素的问题,是因为无法查找spring的DTD描述。这里做个记录手工添加DTD的方法
window--》preferences--》MyEclipse--》Files and Editors--》XML--》XML Catalog
1)点击ADD
2)Key Type:选择URL
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)重新打开配置文件测试一下
window--》preferences--》MyEclipse--》Files and Editors--》XML--》XML Catalog
1)点击ADD
2)Key Type:选择URL
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)重新打开配置文件测试一下