zoukankan      html  css  js  c++  java
  • spring bean 配置

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:p="http://www.springframework.org/schema/p" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        ">
    
        <bean id="car1" class="com.smart.Car">
            <property name="brand">
                <value><![CDATA[<font color="red">奥迪A6</font>]]></value>
            </property>
            <property name="color">
                <value>红色</value>
            </property>
            <property name="maxSpeed">
                <value>230</value>
            </property>
        </bean>
    
        <bean id="car2" class="com.smart.Car">
            <property name="brand" value="吉利" />
            <property name="color" value="蓝色" />
            <property name="maxSpeed" value="200" />
        </bean>
    
        <bean id="car3" class="com.smart.Car" 
            p:brand="红旗CA72" 
            p:color="黑色" 
            p:maxSpeed="200" />
    
        <bean id="car4" class="com.smart.Car">
            <constructor-arg index="0" type="java.lang.String" value="奥迪A6" />
            <constructor-arg index="1" type="java.lang.String" value="白色" />
            <constructor-arg index="2" type="int" value="250" />
        </bean>
    
        <bean id="boss1" class="com.smart.Boss">
            <constructor-arg index="0" value="John" />
            <constructor-arg index="1" ref="car1" />
        </bean>
        <bean id="boss2" class="com.smart.Boss">
            <property name="name" value="Jack" />
            <property name="car" ref="car1" />
        </bean>
    </beans>
  • 相关阅读:
    Jenkins 完成安装环境配置
    Jenkins中文社区的所有镜像地址
    VueX源码分析(3)
    VueX源码分析(2)
    VueX源码分析(1)
    Element表单验证(2)
    Element表单验证(1)
    配置淘宝镜像,不使用怪异的cnpm
    React动态import()
    cnpm 莫名奇妙bug 莫名奇妙的痛
  • 原文地址:https://www.cnblogs.com/asnjudy/p/4172657.html
Copyright © 2011-2022 走看看