以applicationContext.xml為例說明
MyEclipse6.5中
菜單欄 - Window - Preferences - MyEclipse Enterprise Workbenck - Files and Editors - XML - XML Catalog -
右邊選中User Specified Enteries - Add -
彈窗中Key Type選URI;
Location - file System - 選到相應的.xsd檔案(如spring_home\dist\resources\spring-beans-2.0.xsd);
key項中最後補充加入"/spring-beans-2.0.xsd"
這時會在<beans>标簽中加入相應代碼如下,也可不做以上操作,直接将如下代碼直接寫在applicationContext.xml檔案中
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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-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.0.xsd">
<!-- 其他配置 -->
</beans>