Imagine a staged application context with different phases. We start with an early phase to define the necessary infrastructure. The xml application contexts are loaded sequenti
Both map
and list
has this attribute named merge=true|false
for merging two lists. Alternatively you can use MethodInvokingFactoryBean
for calling already defined list's add method to add extra items later.
Let's go over your example.
1) First the second scenario with MethodInvokingFactoryBean
. Instead of defining the way you do, I defined your beans a little differently.
In another application content file, you can do the following to extend the map.
2) Now the first scenario. For this one, I just found something on page http://forum.springsource.org/showthread.php?t=53358
Hope it helps.