Add a Collection to your form bean. Add getter and setter methods to the form bean. Add code to your action class (usually a prepare-type action) to look up the data (or call the appropriate facade/delegate method) and populate the collection on the form. Modify your resultant jsp to use the Collection in an <html:options> tag within an <html:select> tag. Check the docs on the struts site for specific details or reply with more specific questions. ----- Original Message ----- From: "Mark Ayad" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, November 05, 2002 10:01 AM Subject: Dynamic select menu in JSP
> I would like to know the best method to populate a form in a JSP page with > dynamic select menu, where the number of options in the select depends on a > query to the database. Specifically where is best to place the functionality > ? > > <html:select property="singleSelect" size="10"> > <html:option value="Single 0">Single 0</html:option> > <html:option value="Single 1">Single 1</html:option> > ....... > ....... > <html:option value="Single n">Single n</html:option> > ....... > </html:select> > > Previous to Struts I would have looped aropund a resultsset. > > What do people use ? > > > Regards > > Mark > > > > > > -- > To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org> > -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>