我想将这些隐藏输入的值组合成一个单独的隐藏输入中的 json 格式字符串。我如何实现这一目标?
<c:forEach var="perForm" items="${importedPersonForms}" varStatus="count">
<input type="hidden" name="importedPersonForms[${count.count - 1}].firstname" value="${perForm.firstname}"/>
<input type="hidden" name="importedPersonForms[${count.count - 1 }].lastname" value="${perForm.lastname}"/>
<c:forEach var="position" items="${perForm.positions}">
<input type="hidden" name="importedPersonForms[${count.count - 1 }].positions" value="${position}"/>
</c:forEach>
<c:forEach var="organization" items="${perForm.organizations}">
<input type="hidden" name="importedPersonForms[${count.count - 1 }].organizations" value="${organization}"/>
</c:forEach>
<input type="hidden" name="importedPersonForms[${count.count - 1 }].addressList[0].countryCode" value="${perForm.addressList[0].countryCode}"/>
<input type="hidden" name="importedPersonForms[${count.count - 1 }].addressList[0].number" value="${perForm.addressList[0].number}"/>
<input type="hidden" name="importedPersonForms[${count.count - 1 }].addressList[0].fixedLine" value="${perForm.addressList[0].fixedLine}"/>
</c:forEach>