HTML 页面的 批量删除的按钮

 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://www.cnblogs.com/JBLi/p/10598284.html