OK this is driving me crazy and I'm about to give up...
I'm trying very hard to use the "indexed='true'" feature of
struts to manage a very simple ArrayList of objects in a page. It displays just fin, and I've checked the html code and it's populating the indexed properties just fine. But, when I post the form to an action, the constructor on the form gets called just fine but what I can NOT seem to get to happen correctly, is the part where Struts uses reflection to populated the list with the data on the html page. I just don't get why that part isn't happening... any ideas?
Config excerpt:
<action path="/VehicleDisplay"
type="packagename.presentation.action.vehicle.VehicleDisplayAction"
name="VehicleMaintenanceForm"
scope="request"
validate="false">
<forward name="success" path="vehicle.maintenanceThirdParty"/>
</action>
<action path="/SaveVehicleInfo"
type="packagename.presentation.action.vehicle.SaveVehicleInfoAction"
name="VehicleMaintenanceForm"
scope="request"
validate="true">
<forward name="success" path="vehicle.maintenanceThirdParty"/>
<forward name="stay" path="/SetupNewAccount.do"/>
<forward nam
Form:
public class VehicleMaintenanceForm extends ValidatorForm {
private List vehicleList;
public VehicleMaintenanceForm() {
vehicleList=new ArrayList(4);
for (int i=0; i<4; i++) {
vehicleList.add( new TagDTO());
}
}
public List getVehicleList() {
return vehicleList;
}
public void setVehicleList(List vehicleList) {
this.vehicleList = vehicleList;
}
}
Jsp excerpt:
<html:form action="/SaveVehicleInfo">
<logic:iterate name="VehicleMaintenanceForm" property="vehicleList" id="lineItem" indexId="rowNum">
<tr class="oddd">
<td align="center">
<html:text name="lineItem" indexed="true" property="licPlate"/>
</td>
</logic:iterate>
A breakpoint and trace thru the action "SaveVehicleInfo" confirms that the list is empty and was never populated by the framework...
Any ideas anyone?? What piece am I missing here? Thanks