Hi Sadia, I think you must refresh your Java basics especially Java Collections, you usually don't use arrays for your models because the Collection framework of Java is better.
Also, try to refresh your Object Orientation. It could have been better if you have a Food class instead. public class Food{ private String name; private String description; // getters and setters } and then using a List implementation from the Collections framework instead of arrays: private List<Food> foods; Regards, Bob On Wed, Nov 25, 2009 at 12:09 PM, Sadia Butt <buttsa...@yahoo.com> wrote: > Hi again Guys > > I am making a form which has a radio button as well as a checkbox. Now when > making the bean class I can easily have the data type for username as > String, birthdate as Date for age I ll have an int..for radio button(gender) > I have declared it as a char. but what should I choose for the > checkbox????as multiple values?? I thought of array of String or array of > char??? > > the field is of favorite foods. 3 choices Pizza, Pasta, Chinese...the user > can choose all 3 of them as well. Also can I choose any > collection???Iterator ?? > > <c:forEach items="${paramValues.food}" var="current"> > <c:out value="${current}"/> > </c:forEach> > > <td>Favorite Foods:</td> > <td><input type="checkbox" name="food" value="z">Pizza<br> > <input type="checkbox" name="food" value="p">Pasta<br> > <input type="checkbox" name="food" value="c">Chinese</td> > > Now in the bean class I have > > private String userName; > private Date birthDate; > private char gender; > private String[] foods; or private char[] foods??? > > Thanks > > Sadia butt > > -- > You received this message because you are subscribed to the Google > Groups "Java EE (J2EE) Programming with Passion!" group. > To post to this group, send email to > java-ee-j2ee-programming-with-passion@googlegroups.com > To unsubscribe from this group, send email to > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com> > For more options, visit this group at > > http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en