I'm new to using Spring with Java and I'm trying to instantiate a simple HashMap using Spring's configuration file. I want to know what to put in the Spring config context file to make this work. I know util:map
is somehow used, but all the example codes I'm seeing are either complex instantiations (e.g. for HashMap<Class<?>,List<String>>
) from which understanding is difficult, or the author hasn't explained well what he/she has done, leaving me frustrated!
What do I need to put in my beans.xml context file if I want to generate a simple HashMap of this specification ? ...
HashMap<Integer, String>
Please show a clear example showing the XML and stating any naming assumptions you're making.