I don't have the code with me right now, but I learned to solve this with the sample code from: http://www.developer.com/java/other/article.php/2233591
On your <html:text>, you need to use the name and property attributes, and set indexed=true. This is an excerpt from the article. <c:forEach var="lines" items="${purchaseOrderBeanForm.map.lines}" > <TR><TD><html:text indexed="true" name="lines" property="partNumber"/></TD> <TD><html:text indexed="true" name="lines" property="quantity"/></TD> <TD><html:text indexed="true" name="lines" property="price"/></TD></TR> </c:forEach> You can also look at the <nested> tags and the tutorials from keyboardmonkey.com. --- Shyam A <[EMAIL PROTECTED]> wrote: > Hubert, > Thanks again for your mail. I have not tried using > mapped properties, instead I stuck to my original idea > of using an array of text fields/hidden fields with > corresponding String[] in my form bean. > > I have a problem with validating the array of text > fields,i.e., if there is a validation error, the > values entered in the text fields are not retained. > > Given below is the message I posted to 'struts-user'. > > Do you think using indexed properties will help solve > my problem? If yes, could you send a sample? > > Hope it is not a bother. > > Thanks, > Shyam > > #################################################### > Hi, > > I use a String[] in my form bean to handle a dynamic > array of text fields. > > In my ActionForm, I have > > private String[] candList; > > public String[] getCandList() > { > return candList; > } > > public void setCandList(String[] aCandList) > { > candList = aCandList; > } > > ---------------------------- > > In my JSP, I use > > <html:text property="candList" size="25" > maxlength="25"/> > > within a <logic:iterate> tag. > > My problem is that when a validation error occurs in > the validate() method of my form bean, the text fields > are populated with junk values. The text fields do not > retain the user entered values. However, the user > entered values can be printed out in the validate() > method. > > How do I work around this problem? > > Any help, suggestions/pointers will be greatly > appreciated. > > Thanks, > Shyam > > > > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote: > > Sorry, but I haven't tried anything with mapped > > properties yet. All I've > > done are indexed properties. > > Ask this on the user list. I'm sure someone who's > > tried it will respond. > > > > Hubert > > > > --- Shyam A <[EMAIL PROTECTED]> wrote: > > > Hubert, > > > > > > Sorry to re-open my issue. I'm having trouble in > > > getting started with mapped properties due to time > > > constraints. Do you have any code sample (Form > > > Bean/JSP)? > > > > > > Thanks, > > > Shyam > > > > > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote: > > > > Your timing was nice because that's just the > > problem > > > > I was solving yesterday. > > > > Hope that helped. > > > > > > > > --- Shyam A <[EMAIL PROTECTED]> wrote: > > > > > Hubert, > > > > > > > > > > Thanks for your help. I really appreciate it. > > > > > > > > > > Shyam > > > > > --- Hubert Rabago <[EMAIL PROTECTED]> > > wrote: > > > > > > > > > > > > > > > > > > > > > http://jakarta.apache.org/struts/faqs/indexedprops.html > > > > > > > > > > > > > > > > > > > > > http://www.developer.com/java/other/article.php/2233591 > > > > > > > > > > > > Also, > > > > > > > > > > > > > > > > > > > > > http://marc.theaimsgroup.com/?l=struts-user&s=LazyList > > > > > > > > > > > > - Hubert > > > > > > > __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]