wood burning stoves
The moose likes JSP and the fly likes help in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "help in JSP" Watch "help in JSP" New topic

help in JSP

Mukesh Dubey

Joined: Mar 19, 2004
Posts: 4

I have a bean like this:

class WorkOnExpense{
private String inventory;
private Double amount;
private String check;
private String voucher;
private List items;
private List accountNo;

and i am setting all this values after getting it from datbase.

Now i am able to print values of inventory, amount check in jsp page but not able to print List type properties. How to print this using <logic:iterate> or using nested tag.

for printing other values i am writing like this

<jsp:useBean id="workOnExpenseVO" type="com.ci.prize.view.vo.releaseexpense.WorkOnExpenseVO" scope="session"/>

<bean:write name="workOnExpenseVO" property="amount" />

and i am getting the list also using this.

<bean:write name="workOnExpenseVO" property="items" />
Now how can i iterate this list and print all the values in jsp page.

Please help me on this..

Thanks in advance!!


Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
Mukesh you posted in wrong place. Post your query in JSPs category
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

The JSTL <c:forEach> tag will allow you to iterate through the List.

[Asking smart questions] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: help in JSP
It's not a secret anymore!