I'm using the Map-Backed action form approach as detailed here:
http://jakarta.apache.org/struts/userGuide/building_controller.html#map_action_form_classes
I have a form bean with a one instance of a Value Object(i.e.customersVO),
this value object contain an ArrayList(i.e. CustomerDetails) of other Value
objects(i.e. CustomerDetailsVO).
----------
Form Bean
----------
public class customersForm extends ActionForm {
private customersVO customers = null;
/*Get & Set methods for the customers Value Object*/
public void setCustomers(customersVO pCustomersVO ) {
customers = pCustomersVO;
}
public customersVO getCustomers() {
return customers;
}
/*Get & Set methods for the ArrayList of VO's contained within the
customersVO*/
public Object getCustomerDetail(int key) {
return customers.getCustomerDetails().get(key);
}
public void setCustomerDetail(int key, Object value) {
customers.getCustomerDetails().set(key, value);
}
}
-----------
JSP Source
-----------
<logic:iterate name="myForm" property="CustomerDetails" indexId="rowIndex">
<% String name = "customerDetail["+rowIndex+"]";%>
<html:text property="<%=name + ".firstName"%>"/>
This works fine but i personally don't like including scriplet code like
this in my jsp's. Is there another way can do this??
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
- Re: Map-backed ActionForms Pat Quinn
- Re: Map-backed ActionForms Mark
- Re: Map-backed ActionForms Justin Ashworth
- Re: Map-backed ActionForms Pat Quinn