This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes How to iterate multiple list in an object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to iterate multiple list in an object?" Watch "How to iterate multiple list in an object?" New topic
Author

How to iterate multiple list in an object?

Hasitha Su
Greenhorn

Joined: May 15, 2011
Posts: 3
I have created a class called "Product" which contains weekly sales qty, order qty & good received qty in 3 integer lists.

public class Product{

private String productCode;

private String productName;

List<Integer> salesQty;
List<Integer> orderQty;
List<Integer> receiveQty;

}



I want to display it in a jsp page as follows:



Product Code : product1 Product Name : product-001

Week No : 01 02 03 04 ----
Sales Qty : 10 20 15 16
Order Qty : 20 15 15 10
Recv. Qty : 10 20 10 15


Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29275
    
140

Hasitha,
Welcome to CodeRanch!

You can use the JSTL c:forEach tag or the Struts logic:iterate tag to loop through the sublists.


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to iterate multiple list in an object?
 
Similar Threads
Multiuser concurrency and Contention
Basic Database help
HashMap doubt?
Reading Objects and Formatting Ouput
Reading and Writing Objects