function delAll(){
         var s;
         $("[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 >
        delete from student where sid in 
            <foreach collection="array" item="sids" close=")" open="(" separator=",">
                #{sids}
            </foreach>
    </delete>

 

HTML  页面的  批量删除的按钮

HTML  页面的  批量删除的按钮

 

相关文章: