Hi All,
I am facing the below mentioned problem, while trying to use dynaActionForm.
In the struts-config, I get an error saying that com.infosys.apmsweb.sample.MyFormBean[] is not a valid type. If I remove [], then the error is not thrown.
When I try deploying, I got an exception saying that index can come only under iterate tag.
I have added all relvant jar�s and tld�s which come in jakarta-taglibs-standard-1.0.6.
Can someone help me on this? Some immediate help on this, would highly be appreciated.
Entry in struts-config
<form-beans>
<form-bean name="myFormBeanList" type="org.apache.struts.action.DynaActionForm" >
<form-property className="org.apache.struts.config.FormPropertyConfig" name="lines" type="com.infosys.apmsweb.sample.MyFormBean[]" size="4" />
</form-bean>
</form-beans>
Jsp form
<html:form action="/end">
<table border="1">
<c:forEach var="lines" items="${myFormBeanList.map.lines}" >
<TR><TD><html:text indexed=�true� name="lines" property="custSSN"/></TD>
</c:forEach>
<tr>
<html:submit value="Submit" />
</tr>
</table>
</html:form>
Execute in Action Class
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward();
// return value
try {
if(null== form)
System.out.println("No Form exists");
if(null!=form){
DynaActionForm poForm = (DynaActionForm) form;
MyFormBean[] list=(MyFormBean[]) poForm.get("lines");
MyFormBean mf=((MyFormBean)list[1]);
System.out.println(mf.getCustSSN());
}
} catch (Exception e) {
// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));
}
// Finish with
return mapping.findForward("success");
}