<?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:p= "http://www.springframework.org/schema/p"Xmlns:tx= "Http://www.springframework.org/schema/tx"Xmlns:context= "Http://www.springframework.org/schema/context"XMLNS:AOP= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp//Www.springframework.org/schema/contexthttp//www.springframework.org/schema/context/spring-context-3.0.xsdhttp//Www.springframework.org/schema/txhttp//www.springframework.org/schema/tx/spring-tx-3.0.xsdhttp//WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOPhttp//www.springframework.org/schema/aop/spring-aop-3.0.xsd "><context:component-scan base- Package= "Com.zzzy.test"/> <aop:aspectj-autoproxy proxy-target-class= "true"/> <!--data Source configuration--<bean id= "DataSource"class= "Org.apache.commons.dbcp.BasicDataSource" > <property name= "Driverclassname"value= "Oracle.jdbc.OracleDriver" > </property> <property name= "url"value= "JDBC:ORACLE:THIN:LOCALHOST:1521:ORCL" > </property> <property name= "username" value= "Scott" > </property> <property name= "password" value= "Tiger" ></property> </bean> <! --factory configuration--<bean id= "Sessionfactory"class= "Org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" > <property name= "DataSource" > <ref bean= "dataSource"/> </property> <property name= "Hibernateproperties" ; <props> <prop key= "Hibernate.dialect" >Org.hibernate.dialect.Oracle9Dialect</prop> <prop key= "Hibernate.show_sql" >true</prop> <prop key= "Hibernate.format_sql" >true</prop> <prop key= "Hibernate.hbm2ddl.auto" >update</prop> <!--used to build to help debug The annotation information, by default is off--<prop key= "Hibernate.use_sql_comments" >false</prop> </props> </property> <!--scanning using annotations The entity class that is in the package, no longer uses the annotatedclasses parameter--<property name= "Packagestoscan" > <list> <value>com.zzzy.test</value> </list> </property> </bean> <bean id= "Transcationmanager"class= "Org.springframework.orm.hibernate3.HibernateTransactionManager" > <property name= "sessionfactory" ref= " Sessionfactory "/> </bean> <tx:advice id=" Txadvice "transaction-manager=" Transcationmana Ger "> <tx:attributes> <tx:method name=" query* "propagation=" REQUIRED "read-only=" true "/> <tx:me Thod name= "add*" propagation= "REQUIRED"/> <tx:method name= "*" read-only= "true"/> </tx:attributes> </tx:advice> <aop:config > <aop:pointcut ID= "Txmethod" expression= "Execution (* COM.ZZZY.TEST.SERVICEDAOIMP: *.*(..)) "/> <aop:advisor advice-ref=" Txadvice "pointcut-ref=" Txmethod "/> </aop:config> <be An id= "Hibernatetemplate"class= "Org.springframework.orm.hibernate3.HibernateTemplate" > <property name= "sessionfactory" ref= " Sessionfactory "/> </bean> </beans>
Spring hosted Struts2 and hibernate configuration files