spring中的依赖检查

时间:2017-08-22 15:23:39   收藏:0   阅读:158
4个依赖检查支持的模式:

注:默认模式是 none

none:

<bean id="obj" class="com.xuzhiwen.spring9.Object1" dependency-check="none">
        <property name="name" value="tom" />
</bean>

simple:

<bean id="obj" class="com.xuzhiwen.spring9.Object1" dependency-check="simple">
        <property name="name" value="tom" />
</bean>

objects:

<bean id="obj" class="com.xuzhiwen.spring9.Object1" dependency-check="objects">
        <property name="name" value="tom" />
</bean>

all:

<bean id="obj" class="com.xuzhiwen.spring9.Object1" dependency-check="all">
        <property name="name" value="tom" />
</bean>

全局默认的依赖检查:

<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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
    default-dependency-check="all">

</beans>

 

原文:http://www.cnblogs.com/beibidewomen/p/7411550.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!