<bean id="Ilogon" class="com.fenghui.system.business.Logon">
            <property name="sessionFactory">
                <ref local="sessionFactory"/>
            </property>
    </bean>
    <bean id="logonBOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager">
            <ref bean="transactionManager" />
        </property>
        <property name="target">
            <ref local="Ilogon" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="insert*">PROPAGATION_REQUIRED</prop>
                <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
            </props>
        </property>
    </bean>
    <bean name="/logonAction" class="com.fenghui.system.action.LogonAction" scope="prototype">
        <property name="logon">
            <ref bean="logonBOProxy" />
        </property>
    </bean>这个是application.xml文件中的代码,第一个<bean>是将SessionFactory注入到dao中,第三个<bean>是dao注入到action中,但是第二个<bean>的功能是什么,各位大虾能不能具体的说一说,谢谢!

解决方案 »

  1.   

    LogonAction由Spring进行管理,别名为/logonAction。
      

  2.   

    恩,这个我知道。第二个bean(别名logonBOProxy)注入到第三个bean(别名/logonAction)中。能不能说说他们是怎样联系的啊,还有logonBOProxy这个里面的那几个属性是什么意思?谢谢!
      

  3.   

    第二个Bean logonBOProxy 是对第一个bean Ilogon的代理类, Spring AOP会为这个代理类增加事务管理,事务管理是由transactionManager管理的,当你调用这个代理类的insert*,get*方法,会产生事务
      

  4.   

            <property name="target">
                <ref local="Ilogon" />
            </property> 
    配置你要增强的原始的对象,target=Ilogon;<property name="transactionAttributes"> 配置事务匹配
      

  5.   

    LS 正解,简单地了讲就是为insert*,get*方法绑定事务。
      

  6.   

    org.springframework.transaction.interceptor.TransactionProxyFactoryBean配置 事物保护的
      

  7.   

     <bean id="ServiceYMBasicplanService" class="com.baosight.spesym.ym.service.impl.YMBasicplanServiceImpl"/>
          <bean id="daoYMBasicplan" class="com.baosight.spesym.ym.dao.impl.YMBasicplanDaoImpl">
          <property name="dao" ref="spesDao"></property>
          </bean>
    这种方式  <property name="dao" ref="spesDao"></property>
    这个我不怎么理解哪位大虾能解释下