java取得复选框数据(数组)添加到数据库的某一列
public String checkServer()throws Exception{
DictOpenServerRecharge modle = rechargeActivityService.getObject("from DictOpenServerRecharge where id="+id);
String[] checkvalue = servers;
for (int i = 0; i <checkvalue.length; i++) {
modle.setP1sx(checkvalue[i]);
System.out.println(checkvalue[i]);
}
rechargeActivityService.update(modle);
return "check";
}
------解决方案--------------------rechargeActivityService.update(modle); 只更新一次 最后一个 放在for循环试试