• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can i use HashMap in logic:iterate tag?

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI friends,
we can use ArrayList for logic:iterate tag .
But i have some specific requirement to use HashMap.
i am collecting all the value objects into HashMap and put it in request object,
in JSP i would like to iterate over HashMap.
i write like this:
---------------------
<logic:iterate name="hm" id="hm1" scope="request">
<bean:write name="hm1" property="ccyCode"/>
<bean:write name="hm1" property="countryCode"/>
</logic:iterate>
but it is saying no getter method for ccyCode,
why this is?
can n't we use HashMap?
 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Friends,
i gone through net and find the solution for this.
i am replying for my post because if any body have the some problem, they will know.
------------------------------
<logic:iterate name="hm" id="hm1" scope="request">
<bean efine name="hm1" id="iterateOb" property="value" type="<fully qualified name of the value object>"/>
<bean:write name="iterateOb" property="ccyCode"/>
<bean:write name="iterateOb" property="countryCode"/>
</logic:iterate>
 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic