首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

spring学习-未解

2012-07-28 
spring学习--未解Specifying the target bean through the parent attribute creates a reference to a be

spring学习--未解
Specifying the target bean through the parent attribute creates a reference to a bean that is in a parent container of the current container. The value of the parent attribute may be the same as either the id attribute of the target bean, or one of the values in the name attribute of the target bean, and the target bean must be in a parent container of the current one. You use this bean reference variant mainly when you have a hierarchy of containers and you want to wrap an existing bean in a parent container with a proxy that will have the same name as the parent bean.

<!-- in the parent context --><bean id="accountService"  <-- bean name is the same as the parent bean -->    class="org.springframework.aop.framework.ProxyFactoryBean">    <property name="target">        <ref parent="accountService"/>  <!-- notice how we refer to the parent bean -->    </property>  <!-- insert other configuration and dependencies as required here --></bean>

热点排行