zoukankan      html  css  js  c++  java
  • spring随手笔记4:ref的属性

    1.local属性

      引用在同一个xml的bean           只能引用bean的id

    <bean id="HelloWord" class="com.ltf.captha.serviceImpl.HelloWorld" destroy-method="destory">
            <property name="date">
                <ref local="date"/>
            </property>
        </bean>
        <bean id="date" class="java.util.Date"></bean>

    2.bean属性

      引用在同一个xml的bean,或者不在同一个xml的bean     bean还可以引用bean的name

    
    
    <bean id="HelloWord" class="com.ltf.captha.serviceImpl.HelloWorld" destroy-method="destory">
            <property name="date">
                <ref bean="date"/>
            </property>
        </bean>
        <bean id="date" class="java.util.Date"></bean
    
    

    3.parent属性

    <bean id="inheritedTestBeanWithoutClass">
        <property name="name"><value>parent</value></property>
        <property name="age"><value>1</value></property>
    </bean>
    <bean id="inheritsWithClass" class="org.springframework.beans.DerivedTestBean"
          parent="inheritedTestBeanWithoutClass" init-method="initialize">
        <property name="name"><value>override</value></property>
        <!-- age should inherit value of 1 from parent -->
    </bean>
  • 相关阅读:
    前端一些词汇的缩写
    github上值得关注的前端项目
    window注册表
    注册表删除chrome插件
    js二维码扫描
    git push --no-thin
    mac下app store 无法完成您的购物操作
    git终端提示符
    mac 下 apache设置
    windows 下 apache设置
  • 原文地址:https://www.cnblogs.com/ltflike/p/3990268.html
Copyright © 2011-2022 走看看