This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
    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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

example of displaying same collection twice on same page?  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can anyone provide a quick code example of how to display the same collection twice in the same page using 2 <c:foreach loops?
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Use 2 <c:forEach> loops.

What collection is being sent to the page? Most can be iterated over as many times as you'd like, excluding Iterator and Enumeration.
 
Ken Hartz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks for the response. This relates to our last conversation on iterating over an instance of Map.Entry object. You had stated that a converted ResultSet object to Result object passed to a JSP is an instance of the Map object.

Can you show sample code of simply displaying the above type of list twice in the same page (same list) with using 2 <c:foreach loops?

This seems like a simple issue but I just can't seem get the second <c:foreach loop to display that same list. Can you get 2 separate <c:foreach loops in one page that display the same list in 2 separate areas of page etc...?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
The test code that I showed in that topic can be placed on the page as many times as you'd like.

Since this is a continuation of that topic, I'm going to close this one so that the conversation can continue in the original.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!