Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Two ArrayLists For One Table

 
Steve Dyke
Ranch Hand
Posts: 1679
1
  • Mark post as helpful
  • send pies
  • 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?

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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: 1679
1
  • Mark post as helpful
  • send pies
  • 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.
 
Manuel Leiria
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic