• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

configuring Maps in bean factory -> Spring

Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There is a difference between specifying key/value for Properties & Maps in bean factory XML file.

for example, in case of DI-ing the class which is a type of Properties, we use

<bean id="x" class="x.y">
<property name="someProperies">
<prop key="1"> one </prop>
<prop key="2"> two </prop>

and for Maps, we use

<bean id="x" class="x.y">

<property name="someProperies">
<value>Some value</value>


Why is there such difference in specifying properties, as they both are anyway belong to Map? can't we use any one for all Map types?
Could anyone answer me?


It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!