一、将前台jsp页面中的所有你要用到checkbox的name值设为相同,如  
    <input  type="checkbox"  name="userid">  

二、在后台获取参数时,使用数组获取:  
String  userid[]    =  request.getParameterValues("userid");  
String  userIdAll  =  "";  

三、进行数组必要的格式转换,再进行sql操作
if  (userid!=null)  
{  
     for(int  i=0;i<userid.length;i++)  
    {  
        userIdAll = userIdAll + userid[0] + ","  ;  
     }  
     
     userIdAll  =  userIdAll.substring(0, userIdAll.length-1)  
     String  sql  =  "delete  reguser  where  userid  in("  +  userIdAll+  ")";  
          
    //执行sql语句
}  

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-11-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-01-11
相关资源
相似解决方案