开发者_开发问答I understand that a set can be defined as:
<bean id="toolbox" class="tools.Toolbox">
    <property name="tools">
        <set>
            <ref local="foo" />
            <ref local="bar" />
        </set>
    </property>
</bean>
but I can't find anything in the documentation to allow me to define the set first, for example:
<set id="myTools">
    <ref local="foo" />
    <ref local="bar" />
</set>
<bean id="toolbox" class="tools.Toolbox">
    <property name="tools" ref="myTools"/>
</bean>
Does anyone know if this works or if not how it could be accomplished?
Use <util:set>
Here's the namespace:
xmlns:util="http://www.springframework.org/schema/util"
And the schemaLocation:
http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util-3.0.xsd
You want to use the util namespace
<util:set id="myTools">
    <ref local="foo" />
    <ref local="bar" />
</util:set>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论