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>

解决方案 »

  1.   

    类似于文本框,只是后台用一个数组来接受。<th><input name="xxx" type="checkbox"  onclick="clickme(this)"/></th>String[] cheeckBox=request.getAttributes("xxx");
      

  2.   

    每个checkbox后面都有一个删除操作,一条一条的删;还有一个置顶的删除,选中某些个checkbox删除(批量删)
      

  3.   

    单个行里面的删除针对当前记录
    你要通过checkbox批量删除的话,在列表下方另加一个按钮,提交到后台,根据checkbox的值就行删除就可以。