Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

In Struts,<logic:iterate> to iterate over values of hashmap which are arraylist of arraylists

 
pragya ranjan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to iterate over values of hashmap which are arraylist of arraylists using <logic:iterate> ?
We are getting the error as "cannot create iterator for this collection"
 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pragya, welcome to javaranch!

Can you please post the source code which you are using. I think you should not face any problems. When you iterate over a HashMap, the Map.Entry is placed on the value stack. Then you can iterate over the values which will again be an ArrayList, so the array list will be placed on the value stack. Then again you can iterate over that array list using another iterator tag and so on...
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!