一步步调试,先从展现层看看${userId}有没有值?
再有你是放在<s:iterator value="list">迭代器你去做的展现,而你的拼接是拿url跳转传值window.location.href= "del.action?user.userId="+str;
你在打印一下alert(str)你看看提交前有没有值,按理来说checkbox是多选框,所以以前不用struts时候都是这么取值String abc[] = request.getParameterValues("abc");而你的传值是window.location.href= "del.action?user.userId="+str;这么传递的,嗯,你想怎么封装这个值?后台有个userbean,然后有个userId属性??你先一步步调试吧,把代码多复制上来看看

解决方案 »

  1.   

    1、window.location.href= "del.action?user.userId="+str;这个写法不正确。你穿给后台的是userId,这个userId,可能是一个值,也可能是多个值。在后台,你需要设userId为私有变量,并有相应的setter和getter方法。window.location.href= "del.action?userId="+str;2、楼主的sql语句有问题呀。如果是两个或两个以上,假如userId分别为1和2,这个时候你的sql为:delete from Users where userId in(12),而不是delete from Users where userId in(1,2);