Iterate over many input many fields in JSPX?

20 Views Asked by At

I need over some input data in jspx. I created a "Contact" model, like this:

public class Contact implements Serializable {
    private Integer id;
    private String firstName;
    private String lastName;
    private Date birthDate;
    private int version;
    private Set<ContactTelDetail> **contactDetails** = new HashSet<>();
    private Set<Hobby> **hobbies** = new HashSet<>();

    getters and setters

and in the jspx file I want to update this fields. I don't know how I can read contact details, which has corresponding fields example:

<c:forEach var="contactDetails" items="${contact.contactDetails}" varStatus="status">
            <tr><!--<form:label path="contactTelDetail.teltype">${telType}*</form:label>-->
                <td><form:input name="contactDetails[${status.index}].telType"  value="contactDetails[${status.index}].telType" /></td>
                <td><form:input name="contactDetails[${status.index}].telNumber"  value="contactDetails[${status.index}].telNumber" /></td>
          </tr>
        </c:forEach>
0

There are 0 best solutions below