aspose file tools*
The moose likes JSP and the fly likes example of displaying same collection twice on same page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

example of displaying same collection twice on same page?

Ken Hartz
Greenhorn

Joined: Jul 08, 2006
Posts: 14
Can anyone provide a quick code example of how to display the same collection twice in the same page using 2 <c:foreach loops?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ken Hartz
Greenhorn

Joined: Jul 08, 2006
Posts: 14
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

Joined: Jan 10, 2002
Posts: 61221
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: example of displaying same collection twice on same page?