编撰spring配置文件时,不能出现帮助信息(eclipse中xml catalog导入dtd与xsd)

编写spring配置文件时,不能出现帮助信息(eclipse中xml catalog导入dtd与xsd)
由于spring的schema文件位于网络上,如果机器不能连接到网络,那么在编写配置信息时候就无法出现提示信息,解决方法有两种:

1。让机器上网,eclipse会自动从网络上下载schema文件并缓存在硬盘上。

2。手动添加schema文件,方法如下:
windwos->preferences->myeclipse->files and editors->xml->xmlcatalog
点"add",在出现的窗口中的Key Type中选择URI,在location中选"File system",然后在spring解压目录的dist/resources目录中选择spring-beans-2.5.xsd,回到设置窗口的时候不要急着关闭窗口,应把窗口中的Key Type改为Schema location,Key改为http://www.springframework.org/schema/beans/spring-beans-2.5.xsd


<!-------------------------others----------------------------------->

Xml catalog方便struts.xml,applicationContext.xml的创建


导入spring【schema】
\spring 3.0\org\springframework\beans\factory\xml\spring-beans-3.0.xsd
\spring 3.0\org\springframework\context\config\spring-context-2.5.xsd

<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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
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-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
">
     
      

导入struts(对应的keyid从dtd文件中查找)
struts-2.0.dtd ->struts-2.2.1\lib\struts2-core-2.2.2.1目录下
                 struts-2.2.1\src\core\src\main\resources目录下也有
                
xwork-2.0.dtd  ->struts-2.2.1\src\xwork-core\src\main\resource目录下
xwork-validator-1.0.3.dtd  ->struts-2.2.1\src\xwork-core\src\main\resource目录下