• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to loop over two arraylists simultaneously using <c:forEach>?  RSS feed

S Shiva
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tow different arraylists of different lengths that I need to display one below the other.

I used something like this:

I also tried putting ${arrlist2[status.index]} in first loop but all it gives me is its address(controller.bean@7436)
What I mainly need is the count number of arrlist2 should continue from the last count of arrlist1.
arrList2 displays all of its elements.
If I use status.count in loop 2 it starts count from 1. I want it to be arrList1 + current count of loop 2.

How can I do it?
Also is it possible to iterate 2 arraylists simultaneously?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!