AgreementAction.java
public ActionForward doDeleteAll(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// 获取请求参数
……
// 参数校验后业务处理
……
// 返回列表页面
try {
response.sendRedirect("/SNTAXAPP/agreement.do?op=toShowAgreementList");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}agreementList.jsp:
<html:form action="/agreement.do?op=toShowAgreementList" method="post">
<table width="98%" align="center" class="border" id="mytable" border="1" style="padding: 0px">
<thead>
<tr>
<th><input type="checkbox" onclick="clickme(this)"/></th>
<th>序号</th>
<th>申请单号</th>
<th>协议编号</th>
<th>商品总类名称</th>
<th>供应商名称</th>
<th>供应商税号</th>
<th>数量</th>
<th>金额</th>
<th>税额</th>
<th>类型</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${agreementForm.pageBean.dataList}">
<tr>
<td><input type="checkbox" value="${item.agreementNo }" name="agreementNo"/></td>
<td>${item.id }</td>
<td>${item.number }</td>
<td>${item.agreementNo }</td>
<td>${item.goodsName }</td>
<td>${item.sellNameFormat }</td>
<td>${item.sellTaxNo }</td>
<td>${item.amount }</td>
<td>${item.total }</td>
<td>${item.tax }</td>
<td>${item.type }</td>
<td>
<html:link action="/agreement.do?op=toShowAgreementDetail&agreementNo=${item.agreementNo}" target="_bank">详细</html:link>
|
<html:link action="/agreement.do?op=doDelete&id=${item.id}" onclick="return isDel()">删除</html:link>
</td>
</tr>
</c:forEach>
<tr>
<td colspan="12">
<kevin:page formName="agreementForm" />
</td>
</tr>
</tbody>
</table>
</html:form>
public ActionForward doDeleteAll(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// 获取请求参数
……
// 参数校验后业务处理
……
// 返回列表页面
try {
response.sendRedirect("/SNTAXAPP/agreement.do?op=toShowAgreementList");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}agreementList.jsp:
<html:form action="/agreement.do?op=toShowAgreementList" method="post">
<table width="98%" align="center" class="border" id="mytable" border="1" style="padding: 0px">
<thead>
<tr>
<th><input type="checkbox" onclick="clickme(this)"/></th>
<th>序号</th>
<th>申请单号</th>
<th>协议编号</th>
<th>商品总类名称</th>
<th>供应商名称</th>
<th>供应商税号</th>
<th>数量</th>
<th>金额</th>
<th>税额</th>
<th>类型</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${agreementForm.pageBean.dataList}">
<tr>
<td><input type="checkbox" value="${item.agreementNo }" name="agreementNo"/></td>
<td>${item.id }</td>
<td>${item.number }</td>
<td>${item.agreementNo }</td>
<td>${item.goodsName }</td>
<td>${item.sellNameFormat }</td>
<td>${item.sellTaxNo }</td>
<td>${item.amount }</td>
<td>${item.total }</td>
<td>${item.tax }</td>
<td>${item.type }</td>
<td>
<html:link action="/agreement.do?op=toShowAgreementDetail&agreementNo=${item.agreementNo}" target="_bank">详细</html:link>
|
<html:link action="/agreement.do?op=doDelete&id=${item.id}" onclick="return isDel()">删除</html:link>
</td>
</tr>
</c:forEach>
<tr>
<td colspan="12">
<kevin:page formName="agreementForm" />
</td>
</tr>
</tbody>
</table>
</html:form>
你要通过checkbox批量删除的话,在列表下方另加一个按钮,提交到后台,根据checkbox的值就行删除就可以。