I have a map declaration:
<!-- SOME MAP -->
<util:map id="someMap" map-class="java.util.HashMap"
key-type="java.lang.String" value-type="java.lang.String" >
<entry key="0" value="SOME VALUE" />
<entry key="1" value="SOME VALUE 2" />
<entry key="default" value="SOME VALUE 3" />
</util:map>
<!-- SOME MAP REFERENCE -->
<util:map id="someMapRef" map-class="java.util.HashMap"
key-type="java.lang.String" value-type="java.util.HashMap" >
<entry key="0" value ref = "someMap" />
<entry key="default" value="SOME VALUE" />
</util:map>
What is wrong with that? Any suggestion?
Firstly, the XML is not well-formed, it should be:
<entry key="0" value-ref="someMap"/>
Also, according to your definition, the someMapRef
map bean can only contain values of type java.util.HashMap
, but you're trying to set a value for key 0
of SOME VALUE
, which is a String. It can contain Strings, or hashMaps, but not both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With