Struts2接收checkbox的值

Struts2接收checkbox的值:
 
HTML:
<input type="checkbox" name="ssl" value="B1" /><label>B1</label>
<input type="checkbox" name="ssl" value="B2" /><label>B2</label>
<input type="checkbox" name="ssl" value="B3" /><label>B3</label>
<input type="checkbox" name="ssl" value="B4" /><label>B4</label>
 
Action:
private List<String> listCheckbox;
public List<String> getListCheckbox() {
return listCheckbox;
}
public void setListCheckbox(List<String> listCheckbox) {
this.listCheckbox = listCheckbox;
}
 
总结:
1. struts2接收checkbox使用可以使用List接收
原文地址:https://www.cnblogs.com/mgzy/p/3904915.html