spring复杂类型依赖注入

思维导图:
在这里插入图片描述

接着上一篇的代码

applicationContext.xml

<bean id="person1" class="com.lbl.domain.Person">
    <property name="id" value="10"></property>
    <property name="name" value="jack"></property>
    <property name="list">
        <list>
            <value>rose</value>
            <value>rose</value>
            <value>tom</value>
        </list>
    </property>
</bean>

personTest

@Test
public void test02(){
    ClassPathXmlApplicationContext onctext=new
            ClassPathXmlApplicationContext("applicationContext.xml");
    Object person = onctext.getBean("person1");
    System.out.println(person);
}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_37924905/article/details/108963295