Nathan, could you explain in a little more detail:
Is is a use case where you retrieve a value from somewhere which tells you how many empty fields to generate and this value could vary. Then these empty fields are populated with user input and sent to the server to update the database. If so, you could do the following: I would also use org.apache.commons.collections.ListUtils.lazyList() implementation. http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect ions/ListUtils.html#lazyList(java.util.List,%20org.apache.commons.collection s.Factory) The lazyList implementation will create a new object using the specified Factory when Struts indexes into a position in the list which is null. <form-bean name="myForm" type="com.company.MyForm"> <form-property name="colors" type="java.util.List"/> </form-bean> Subclass your DynaActionForm and override the reset() public final class MyForm extends DynaActionForm { private static Logger logger = Logger .getLogger(SearchContractsForm.class.getName()); /** * Reset all bean properties to their default state. This method is * called before the properties are repopulated by the controller servlet. * <p> * The default implementation uses the initial value specified in the * FormPropertyConfig element for each property. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public void reset(ActionMapping mapping, HttpServletRequest request) { super.reset(mapping, request); List colors = ListUtils.lazyList(new ArrayList(), new StringFactory()); this.set("colors", colors); } /** * <code>StringFactory</code> * * @see org.apache.commons.ListUtils */ class StringFactory implements Factory { /** * Create a new instance of the specified object */ public Object create() { return new String(); } } } Define an action which is invoked prior to displaying the jsp. In the action populate the "colors" data member with a List of empty Strings. In the page do one of the following: One way to display the values is like so: <c:forEach var="color" items"${myForm.colors}" varStatus="status"> <c:set var="property" value="colors[${status.index}]"/> <html_el:text property="${property}"/> </c:forEach> Another way would be to leverage the Struts tags: <logic:iterate id="color" name="myForm" property="colors"> <html:text name="colors" property="color" indexed="true"/> </logic:iterate> Either way should render html like: <input type="text" name="colors[0]" value=""/> <input type="text" name="colors[1]" value=""/> <input type="text" name="colors[2]" value=""/> <input type="text" name="colors[3]" value=""/> <input type="text" name="colors[4]" value=""/> ... <input type="text" name="colors[n]" value=""/> Upon submitting the form, Struts will invoke reset() and populate the "colors" data member with a new lazy list. When Struts indexes into an empty location, lazy list will first create a new String at that location and then Struts will populate that with the value sent from the client. That should give you a better idea of how to use indexed properties. hth, robert > -----Original Message----- > From: Nathan Maves [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 08, 2004 3:13 PM > To: Struts Users Mailing List > Subject: Re: dynamic parameters to DynaActionForm > > > Robert, > > I have been researching all morning and still can not find a good > answer. > > I need to send the action a set of parameters like.. > > param1 > param2 > param3 > . > . > . > param# > > The amount of parameters in the form are dynamic. How or what type of > object would you use in a form bean. > > Nathan > > > On Jan 8, 2004, at 11:18 AM, Robert Taylor wrote: > > > Look at IndexedProperties: > > http://jakarta.apache.org/struts/faqs/indexedprops.html > > > > robert > > > >> -----Original Message----- > >> From: Nathan Maves [mailto:[EMAIL PROTECTED] > >> Sent: Thursday, January 08, 2004 1:02 PM > >> To: Struts Users Mailing List > >> Subject: dynamic parameters to DynaActionForm > >> > >> > >> is it possible to have dynamic parameters sent to to a dyna form? > >> > >> I do not know how many or the name of the parameters that are being > >> sent? > >> > >> Nathan > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

