hi everybody, In my application, i am having multilines with facility for adding multiline dynamically .I representing those fields through nested tags.These tag gets set through array of Objects.
So in this scenario how can i validate my multiline fields. if i add new row and try to save it ,it throws exception in populating saying IndexOutOfBound. Please anybody help me to get rid of this problem. Please give me suggestion whether my Form Bean and Jsp is correct for my requirement. FormBean --------------- private List multilineObjects=getObjects(); public void setMultilineObjects(List multilineObjects){ this.multilineObjects=multilineObjects; } public List getMultilineObjects(){ return multilineObjects; } public List getObjects(){ MultilineObjects[] obj=null; ArrayList listOfObjects=null; try{ listOfObjects= businessObjects.getOnLoadObjects(); }catch(Exception e){ e.printStackTrace(); } return listOfObjects; } } MyJSP --------- <nested:iterate id="lineElement" property="multilineObjects" scope="request" > <tr> <td width="20%"> <nested:text property="moduleName" style="width:99%" styleClass="LinesTextboxFont" /> <nested:hidden name="lineElement" property="moduleId" /> </td> <td width="21%" > <nested:text readonly="true" property="shortName" style="width:99%" styleClass="LinesTextboxFont"/> </td> <td width="20%" > <nested:text property="directory" style="width:99%" styleClass="LinesTextboxFont"/> </td> <td width="21%"> <nested:text property="startDate" style="width:99%" styleClass="LinesTextboxFont"/> </td> <td width="20%"> <nested:text property="endDate" style="width:99%" styleClass="LinesTextboxFont"/> <nested:hidden property="whoColumn" /> </td> </tr> </nested:iterate> MyValidation.xml -------------------------- <form name="MultiLineForm" > <field property="moduleName" indexedListProperty="echainModule" depends="required" > <arg0 key="key.label.module" /> </field> </form> Exception Details -------------------------- java.lang.IndexOutOfBoundsException: Index: 25, Size: 24 at java.util.ArrayList.RangeCheck(ArrayList.java:508) at java.util.ArrayList.get(ArrayList.java:320) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:521) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)