You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Candiloro, Heidi" <HC...@swiftrivers.com> on 2001/09/27 19:46:15 UTC
index getters
Indexed getters
I have a problem with my code (included below).... I am not sure if it
is because struts is requiring a naming convention of OrderDetailList or
what.... please help me I have a deadline that I need to meet.
Thanks,
Heidi
I have a OrderVO Bean and a OrderDetailVO Bean
This is the call I am trying to make in my JSP
<bean:write name="order.orderDetailVO[0]" property="quantityOrdered"
scope="session"/>
I know the data is in "order" because I can call a write on it.... and
parse it with Java code as opposed to struts tags.
My OrderVO looks like this:
OrderVO class:
private ArrayList orderDetails;
public void setOrderDetails(ArrayList orderDetails) {
this.orderDetails = orderDetails;
}
public ArrayList getOrderDetails() {
return orderDetails;
}
public OrderDetailVO getOrderDetailVO(int index) {
return (OrderDetailVO)orderDetails.get(index);
}
OrderDetailVO class:
private long quantityOrdered;
public void setQuantityOrdered(long quantityOrdered) {
this.quantityOrdered = quantityOrdered;
}
public long getQuantityOrdered() {
return quantityOrdered;
}