be chosen by the container. Finally, you can also control the merging behavior using the 'merge' attribute of the <util:list/> element; collection merging is described in more detail in the section called “Collection merging”. <util:map/> Before... <!-- creates a java.util.Map instance with values loaded from the supplied 'sourceMap' --> <bean id="emails" class="org.springframework.beans.factory.config.MapFactoryBean"> <property name="sourceMap"> <map> <entry key="pechorin" value="
[email protected]"/> <entry key="raskolnikov" value="
[email protected]"/> <entry key="stavrogin" value="
[email protected]"/> <entry key="porfiry" value="
[email protected]"/> </map> </property> </bean> The above configuration uses a Spring FactoryBean implementation, the MapFactoryBean, to create a java.util.Map instance initialized with key-value pairs taken from the supplied 'sourceMap'. After... <!-- creates a java.util.Map instance with the supplied key-value pairs --> <util:map id="emails"> <entry key="pechorin" value="
[email protected]"/> <entry key="raskolnikov" value="
[email protected]"/> <entry key="stavrogin" value="
[email protected]"/> <entry key="porfiry" value="
[email protected]"/> </util:map> You can also explicitly control the exact type of Map that will be instantiated and populated via the use of the 'map-class' attribute on the <util:map/> element. For example, if we really need a java.util.TreeMap to be instantiated, we could use the following configuration: <util:map id="emails" map-class="java.util.TreeMap"> <entry key="pechorin" value="
[email protected]"/> <entry key="raskolnikov" value="
[email protected]"/> <entry key="stavrogin" value="
[email protected]"/> <entry key="porfiry" value="
[email protected]"/> </util:map> If no 'map-class' attribute is supplied, a Map implementation will be chosen by the container. Finally, you can also control the merging behavior using the 'merge' attribute of the <util:map/> element; collection merging is described in more detail in the section called “Collection merging”. <util:set/> Spring Framework 3.0 Reference Documentation 709