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>
作为一个真正的程序员,首先应该尊重编程,热爱你所写下的程序,他是你的伙伴,而不是工具。