【发布时间】:2014-12-27 09:26:47
【问题描述】:
我在 jsp 中填充一个动态表并将该表提交给 Servlet 。在 Servlet 中,我只能得到 String[] 和 request.getParametersMap() 的每一列,但我想一一处理每一行的数据。 .知道如何实现这一目标吗?
我的桌子是:
<form method=POST action="ProcessTableDataServlet">
<table>
<tr>
<th><input type=text name=city></th>
<th><input type=text name=employe></th>
<th><input type=text name=salary></th>
<th><input type=text name=companyName></th>
<th><input type=text name=experience></th>
<th><input type=text name=Gender></th>
<th><input type=text name=Age></th>
<th><input type=text name=post></th>
<th><input type=text name=hasPassport></th>
</tr>
<tbody>
<tr>
<!-- populating data dynamically -->
<c:forEach var="result" varStatus="status" items="${list}">
<TD>
<input type="text" name="${status.index}" value="${result}" />
</TD>
</c:forEach>
</tr>
</tbody>
</table>
<input type=submit>
</form>
现在我想要的是一个一个地处理每个员工的数据,但是我不能像employee[]、city[]、salary[]、company[] 那样得到每个field[]。等等我的问题是如何逐行处理数据?
【问题讨论】:
-
这个问题还有其他建议吗?我有点卡在这里?
标签: html jsp servlets html-table jstl