• 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 ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Iterate Hashmap of object

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

I am getting the problem to iterate the hashmap of objects.Follwing code works good for a vector but has some problem for HashMap. I know this is becuase hashmap key,value pair. Can any one correct it.



<logic-l resent name="AddTemplateForm" property="hmitemProperties">
<bean:size id="size"name="AddTemplateForm" property="hmitemProperties"/>
<b>Total No. of Template - <%=size%></b>
<logic-l:greaterThan name="size" value="0">
<logic-l:iterate id="itempro" name="AddTemplateForm" property="hmitemProperties">
<bean:write name="itempro" property="propertyName"/>

</logic-l:iterate>
</logic-l:greaterThan>
</logic-l resent>
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the information you want is in the key part of the hashmap, change the bean:write property to propertyName.key. If it is the value part of the hashmap that you want, use propertyName.value.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!