Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can i use HashMap in logic:iterate tag?

 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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
  • 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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic