<!--Spring的配置文件的路径-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:springApplicationContext.xml, <!-- 1.spring的配置文件没有父子之分,即每个配置文件都是独立的。 (注:如果只有一个配置文件的话,那么默认是applicationcontext.xml)2.而struts2的配置文件:1)有一个主配置文件(默认是struts2.xml) 2)主配置文件里面包含其他的子配置文件。-->
classpath:com/heilan/*/spring-*-*.xml,
</param-value>
</context-param><?xml version="1.0" encoding="UTF-8"?>
<!-- 在spring里配置Action:注入业务逻辑实例到Action的属性。 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 在spring里面,每个Action都成了一个Bean -->
<bean id="bookControllerBean" class="com.heilan.book.businessController.BookController" scope="prototype">
<property name="bookBusiness" ref="bookBusinessBean"/>
</bean>
</beans>版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/b_qxzb/article/details/47275933