• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem in Iterating HashMap using logic:iterate

 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to iterate the hashmap using logic:iterate. How to do this?

For example:
In my action class:

HashMap h = new HashMap();
h.put("1","red1");
h.put("2","red2");
h.put("3","red3");
myForm form = myForm actionForm;
form.setH1(h);

In My jSP page, how to iterate it:
I have tried the following things:

<logic:iterate id="mapOutput" name="docListForm" property="h1">
TEST
</logic:iterate>

"TEST" Printed three time, so map is iterating

<logic:iterate id="mapOutput" name="docListForm" property="h1(1)">

</logic:iterate>

The above onbe returne "red1".

But how to iterate the map and I want to display only "red1", red2" and "red3".

Any suggestions/idea on how to achive it?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be useful..

http://struts.apache.org/1.x/struts-taglib/tlddoc/logic/iterate.html


Thanks
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be useful..

http://struts.apache.org/1.x/struts-taglib/tlddoc/logic/iterate.html


Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic