spring+hibernate+struts2继承的相关配置

xiaoxiao2024-04-22  338

<?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-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <!-- 属性文件 --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:config.properties</value> </property> </bean> <!-- 导入其他组件的配置 --> <import resource="classpath:util/dao/dao.config.xml" /> <bean id="productAction" class="product.ProductAction" scope="prototype"> <property name="productDao" ref="productDao" /> </bean> <bean id="productDao" class="product.ProductDaoImpl" parent="dao"> <property name="type" value="product.Product" /> </bean> <bean id="cityInfoAction" class="person.CityInfoAction" scope="prototype"> <property name="cityInfoDao" ref="cityInfoDao" /> <property name="pagination" ref="pagination" /> </bean> <bean id="personInfoAction" class="person.PersonInfoAction" scope="prototype"> <property name="personInfoDao" ref="personInfoDao" /> <property name="cityInfoDao" ref="cityInfoDao" /> <property name="photoDao" ref="photoDao" /> <property name="pagination" ref="pagination" /> </bean> <bean id="cityInfoDao" class="person.CityInfoDaoImpl" parent="dao"> <property name="type" value="person.CityInfo" /> </bean> <bean id="personInfoDao" class="person.PersonInfoDaoImpl" parent="dao"> <property name="type" value="person.PersonInfo" /> </bean> <bean id="pagination" class="util.dao.Pagination" > <property name="size" value="3" /> <property name="no" value="1" /> </bean> <bean id="photoAction" class="person.PhotoAction" scope="prototype"> <property name="photoDao" ref="photoDao" /> </bean> <bean id="photoDao" class="person.PhotoDaoImpl" parent="dao"> <property name="type" value="person.Photo" /> </bean> <!-- 有关hibernate映射文件的配置 --> <bean id="mappingResources" class="java.util.ArrayList"> <constructor-arg> <list> <value> product/entity.hbm.xml </value> <value> person/person.hbm.xml </value> </list> </constructor-arg> </bean> <!-- 有关datasource的配置 --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>${jdbc.driverClassName}</value> </property> <property name="url"> <value>${jdbc.url} </value> </property> <property name="username"> <value>${jdbc.username}</value> </property> <property name="password"> <value>${jdbc.password}</value> </property> </bean> <!-- 使用annotation风格的事务AOP --> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> </beans>  

applicationContext.xml的相关配置

 

相关资源:spring+hibernate+Struts2集成
转载请注明原文地址: https://www.6miu.com/read-5015170.html

最新回复(0)