日期:2014-05-17 浏览次数:20853 次
<?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:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd   
http://www.springframework.org/schema/context   
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:annotation-config />
<!--注解式事务配置驱动-->
    <tx:annotation-driven transaction-manager="transactionManager"
        proxy-target-class="true" />
    <!--
        业务类bean的实现类标注了@Transactional注解,所以会被 tx:annotation-driven注解驱动自动织入事务增强
    -->
    <!-- 配置事务管理器 -->
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref bean="sessionFactory" />
        </property>
    </bean>
    <!-- 使Spring关注Annotation -->
    <context:annotation-config />
    <context:component-scan base-package="com.xx.service" />
    <context:component-scan base-package="com.xx.service" />