function delAll(){
var sid="";
$("[name='ids']:checked").each(function(){
sid+=$(this).val()+",";
})
sid = sid.substring(0, sid.length - 1);
window.location.href="${path}/delAll.action?sid="+sid;
alert(sid)
}
//delAll.action
@RequestMapping("delAll.action")
public String delAll(String sid) {
String[] split = sid.split(",");
boolean flag=studentService.delAll(split);
System.out.println(flag);
return "redirect:get.action";
}
<delete id="delAll">
delete from student where sid in
<foreach collection="array" item="sids" close=")" open="(" separator=",">
#{sids}
</foreach>
</delete>
![](https://img2018.cnblogs.com/blog/1536927/201903/1536927-20190326094231926-413064666.png)
![](https://img2018.cnblogs.com/blog/1536927/201903/1536927-20190326094241545-2007656776.png)