| Author |
how to use logic:iterate for ArrayLists withing Collection
|
Ashimashi Kabashi
Ranch Hand
Joined: Sep 11, 2006
Posts: 84
|
|
Howdy Ranchers. I am having a little trouble with this. I am trying to use the logic:iterate tag to iterate through a Collection. But the Collection does not have the values itself. The Collection is a collection of ArrayLists and the ArrayLists have the Strings which I want to display. What do I need to do on the jsp page? Do I need a nested logic:iterate? Your help is always appreciated!!
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
Hi there! Have you tried the nested logic:iterate tag? What happened?
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Ashimashi Kabashi
Ranch Hand
Joined: Sep 11, 2006
Posts: 84
|
|
I am struggling with that actually.. I know how to do this if the Collection had the actual string values etc. But the Collection has arraylists and the arraylists have the string values.. my code is
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Ashimashi, You would use nested logic:iterate tags. The outer one would use the java.util.ArrayList type. The inner one would use String.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Ashimashi Kabashi
Ranch Hand
Joined: Sep 11, 2006
Posts: 84
|
|
If I do something like this (while populating the Collection) where PlatformVO is a bean that I am using and represent it like this (on the jsp): Then everything is fine.... But I dont want to fill the Collection with Beans..I want to fill it with ArrayLists, the reason is the that when you use a bean you have to use the property attribute and are bound to use only the attributes defined in the bean. But I dont want to be bound to the bean as my arraylist contains other columns. Thanks
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
That is close. I was thinking more like: [edited to fix typo in name] [ October 12, 2008: Message edited by: Jeanne Boyarsky ]
|
 |
 |
|
|
subject: how to use logic:iterate for ArrayLists withing Collection
|
|
|