我需要jspx中的一些输入数据。我创建了一个“联系”模型,如下所示:
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
并在jspx文件中我想更新这个字段。我不知道如何阅读联系方式,其中有相应的字段示例:
<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>