• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to iterate multiple list in an object?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hasitha,
Welcome to CodeRanch!

You can use the JSTL c:forEach tag or the Struts logic:iterate tag to loop through the sublists.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic