I know, but by this way I can't use the FormAction objects to fill the form.
----- Original Message ----- From: "Sai Prasad Baba Subramanyan (Cognizant)" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, June 06, 2002 10:03 AM Subject: RE: parametred name fields Yes, as you can use HttpServletRequest parameter in public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) method to do it. -Sai -----Original Message----- From: Nicolas Lapenne [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 01:34 PM To: Struts Users Mailing List Subject: parametred name fields Hello, If I have a jsp file with an undeterminated number of components, how can I use the ActionForm validation with parametred name fields ? Is it possible with struts ? How ? example : I want the user put the surname and name of n men in a form, and use a ActionForm without create n instance values. ********* myFile.jsp ********* <% int n = Integer.parseInt( (Integer) request.getAttribute("number")); for(int i=0, i<n, i++){ %> <tr> <td>Surname :</td> <td> <html:text property="surname<%=i%>" /> </td> </tr> <tr> <td>Name :</td> <td> <html:text property="name<%=i%>" /> </td> </tr> <% } %> ****** MyActionForm.java ****** package myStrutsProject.form; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; import myStrutsProject.commun.*; public final class MyActionForm extends ActionForm { private String surname; private String name; // Getters & Setters public String getSurname() { return surname; } public String setName(String name) { this.name = name; } public String getName() { return name; } public String setName(String name) { this.name = name; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (surname = null || name = null) { errors.add("name and surname required", new ActionError("error.surnameAndNameRequired")); } return errors; } } -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ---------------------------------------------------------------------------- ---- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

