Thanks for you valued suggestions. Here is what we are doing, kindly advise if the approach is correct since we are either hitting the nullpointerexception or not getter method exception:
in jsp:
<logic:iterate id="fcst" name="fcst" indexId="counter">
<html:select name="fcst" property="strType">
<html
ptions collection="type" property="strType" />
</html:select>
The iterate create this HTML component for 10 rows.
</logic:iterate>
It doesnot allow us to set the indexed=true property in the select, it complains that it is not part of the tag lib.
if we do:
<html:select property="strType[0]">
<html
ptions collection="type" property="strType" />
</html:select>
for
testing, it doesnot find the correct getter method.
in ActionForm:
public class FinancesUpdateForm extends ActionForm {
private List strCategory;
public void setStrCategory(int index, String strCategory) {
this.strCategory.set(index, strCategory);
}
public String getStrCategory(int index) {
return (String)this.strCategory.get(index);
}
in Action class:
public class FinancesUpdateAction
extends Action {
public ActionForward perform(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
FinancesUpdateForm frm = (FinancesUpdateForm)actionForm;
System.out.println(frm.getStrCategory(0));
return actionMapping.findForward("success");
}
}
will extremely appreciate your early response.
thanks.