• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Using Two ArrayLists For One Table

 
Ranch Hand
Posts: 2274
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two ArrayLists. I need ArrayList one to populate column one of my table and ArratList two to populate column two. Here is the code for first part but how do I get the second part to work?

 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have two ArrayLists or an ArrayList of ArrayLists?

If it's the latter, you can nest c:forEach tags like this:

[ July 17, 2007: Message edited by: Ben Souther ]
 
Steve Dyke
Ranch Hand
Posts: 2274
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right now I have two separtate ArrayList. If this is not right I am willing to do what ever to correct it.
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the simple approach is to create an ArrayList with the results of both and then a simple foreach tag will do the job.
Example:

Do you see the big picture here?
Now just pass the arraylist tmp to the jsp page and with a single foreach tag you'll do the job
 
I don't like that guy. The tiny ad agrees with me.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic