Spring的配置除了applicationContext.xml外,往往还需要配置action和beans,相关配置文件命名为:applicationContext_actions.xml和applicationContext_beans.xml,继上次介绍了Spring——SSH (Spring+Struts+Hibernate)框架搭建之配置文件序列二后,这次主要介绍一下applicationContext.xml的配置。
<?xml version="1.0" encoding="UTF-8"?>
<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-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd" >
<bean name="testAction" class="net.cxiny.action.TestAction" scope="prototype">
<property name="testMgr" ref="testMgr" />
</bean>
</beans>