我将以下代码放入 Jsp 中,在其中我根据从数据库检索的参数值动态生成表。我想在每一行旁边都有一个编辑按钮,然后按提交我想向我的 servlet 提交一个表单。但是我不能把a放在里面,我需要帮助..这是代码:
<table border="1">
<tr>
<th>Customer Name</th>
<th>Customer Surname</th>
<th>Customer Email</th>
<th>Customer Adress</th>
<th>Customer Contact Details</th>
</tr>
<c:forEach items="${ccustomers}" var="customer" >
<tr>
<form action="myController" method="POST">
<td><input value="${customer.customerName}" name="customerNameEdit"/></td>
<td><input value="${customer.customerSurname}" name="searchForCustomerSurName"/></td>
<td><input value="${customer.email}" name="customerEmailEdit"/></td>
<td><input value="${customer.adress}" name="customerAdressEdit"/></td>
<td><input value="${customer.phoneNumber}" name="customerPhoneEdit"/></td>
<input type="button" value="edit" onclick="this.form.submit()"/>
<input type="hidden" name="<%=WebParamsList.PARAM_PAGENAME%>" value="searchPage"/>
<input type="hidden" name="<%=WebParamsList.SEARCHCRITERIA%>" value="customers"/>
<input type="hidden" name="customerIdForEdit" value="${customer.customerId}"/>
<input type="hidden" name="<%=WebParamsList.RESULTPAGEPARAM%>" value="edit"/>
</form>
</tr>
</c:forEach>
</table>