I have a DynaValidatorActionForm with the following property
<form-bean name="frm" type="MyForm">
<form-property name="children" type="java.util.ArrayList" />
</form-bean>
The JSP looks like this..
<logic:iterate name="frm" id="child" property="children" indexId="index" >
<tr>
<td>
<html:text name="frm" property='<%= "children[" + index +"]" %>' />
</td>
</tr>
</logic:iterate>
I have an Add Row which does the following in the Action
public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaValidatorActionForm dynaForm = (DynaValidatorActionForm) form;
ArrayList l = (ArrayList) dynaForm.get("children");
l.add("new child " + l.size());
dynaForm.set("children", l);
return mapping.findForward("success");
}
The above works fine, as long as my form is defined to be
in session scope. It gives me a
java.lang.IllegalArgumentException: No bean specified
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
when I define the bean in request scope
<form-bean name="frm" type="MyForm">
<form-property name="children" type="java.util.ArrayList" />
</form-bean>
The JSP looks like this..
<logic:iterate name="frm" id="child" property="children" indexId="index" >
<tr>
<td>
<html:text name="frm" property='<%= "children[" + index +"]" %>' />
</td>
</tr>
</logic:iterate>
I have an Add Row which does the following in the Action
public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaValidatorActionForm dynaForm = (DynaValidatorActionForm) form;
ArrayList l = (ArrayList) dynaForm.get("children");
l.add("new child " + l.size());
dynaForm.set("children", l);
return mapping.findForward("success");
}
The above works fine, as long as my form is defined to be
in session scope. It gives me a
java.lang.IllegalArgumentException: No bean specified
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
when I define the bean in request scope