This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Can i use HashMap in logic:iterate tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can i use HashMap in logic:iterate tag?" Watch "Can i use HashMap in logic:iterate tag?" New topic
Author

Can i use HashMap in logic:iterate tag?

Mallik Avula
Ranch Hand

Joined: Nov 30, 2006
Posts: 86
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?


Thanks & Regards<br />Mallik Avula<br />SCJP1.4
Mallik Avula
Ranch Hand

Joined: Nov 30, 2006
Posts: 86
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>
 
GeeCON Prague 2014
 
subject: Can i use HashMap in logic:iterate tag?