首页 > 编程语言 > 详细

Spring集合配置

时间:2015-09-22 18:21:08      阅读:218      评论:0      收藏:0      [点我收藏+]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <bean id="saxophone" class="com.stono.sprtest.Saxophone"></bean>
    <bean id="cymbal" class="com.stono.sprtest.Cymbal"></bean>
    <bean id="duke" class="com.stono.sprtest.Duke">
        <property name="instruments">
            <set>
                <ref bean="saxophone"/>
                <ref bean="saxophone"/>
                <ref bean="cymbal"/>
                <null/>
            </set>
        </property>
        <property name="name" value="#{saxophone.getName()}" />
        <property name="name2" value="#{saxophone.name}" />
        <property name="name3" value="#{saxophone.getName()?.toUpperCase()}" />
        <property name="name4" value="#{saxophone.name?.toUpperCase()}" />
    </bean>
</beans>

 

Spring集合配置

原文:http://www.cnblogs.com/stono/p/4829599.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!