<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<% @taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<script type= "Text/javascript" src= "${pagecontext.request.contextpath}/js/jquery-1.8.3.js" ></script>
<script type= "Text/javascript" >
$ (function () {
$ ("#selectAll"). Click (function () {
$ ("input[type=checkbox]:gt (0)"). attr ("Checked", "checked");
});
$ ("#deleteAll"). Click (function () {
var array=new array ();
$ ("input[type=checkbox]:gt (0): Checked"). each (function () {
Array.push (This). Parent (). Next (). text ());
});
Console.log (array);
location.href= "${pagecontext.request.contextpath}/employee/batchdelete?ids=" +array;
});
});
</script>
<body>
<table>
<tr>
<th><input type= "checkbox" id= "SelectAll"/></th>
<th> User id</th>
<th> User name </th>
<th> User Sex </th>
</tr>
<c:foreach items= "${requestscope.list}" var= "E" >
<tr>
<td><input type= "checkbox"/></td>
<td>${e.id}</td>
<td>${e.name}</td>
<td>${e.gender}</td>
</tr>
</c:forEach>
</table><br/>
<input type= "button" value= "bulk Delete" id= "DeleteAll"/>
</body>
JS Select all Delete