This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Iterating <c:foreach> to get values from sublist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Iterating <c:foreach> to get values from sublist" Watch "Iterating <c:foreach> to get values from sublist" New topic
Author

Iterating <c:foreach> to get values from sublist

Amit Vakodkar
Greenhorn

Joined: May 28, 2007
Posts: 10
Hi,

I have issues in retrieving code while using <c:foreach> tag, the scenario is like this

Code is just for Understanding, nt real code, assume productList & imageList are both having values:

--------------This is my JAVA CODE------------------------------
List containedList = new Arraylist();
List productList = <getDetails>
List imageList = <getDetails>

containedList.add(productList);
containedList.add(imageList);
--------------This is my JAVA CODE------------------------------

I am passing this containedList obj to the JSP page, now here is the Issue, i am not aware how to retrieve the data from both "productList " & "imageList ", using c:foreach, if possible thru any other tag please suggest. Need is ASAP.

Thanks.



Amit Vakodkar
Greenhorn

Joined: May 28, 2007
Posts: 10
Basic thing is that i am not an expert in c:foreach tag, the prob is how to get the values using c:foreach
Anuj Rathi
Greenhorn

Joined: Sep 23, 2009
Posts: 4
Try iterating in this way.

Amit Vakodkar
Greenhorn

Joined: May 28, 2007
Posts: 10
Thanks Anuj, this was the code i was looking out for, but wasnt able to test it as the requirement was changed & thus wasnt able to implement it, but got the whole thing from it. Thanks for the Code Mate. Obliged!
 
jQuery in Action, 2nd edition
 
subject: Iterating <c:foreach> to get values from sublist
 
Similar Threads
EL with List of Objects
Iterating over Map using JSTL
bean and for each
Error in Struts
EL tag for setting textfield values using Javascript