How do I set a default value for a util:map in the spring framework?
If I pass "thisThing" I would like it to go to value-ref "call_to_default".
<util:map id= "someID" map-class="org.apache.commons.collections4.map">
<constructor-arg value= "call_to_default"/>
<entry key="someStuff" value-ref="call_to_someStuff">
You can't do this in Spring, I'm afraid.
That said, in Java 8, Maps have a
getOrDefault method which does what you're describing. So if you specify a default value as a different property of your bean (the bean that uses the map, for clarity), you can integrate it with this method.