首先在jsp页面上checkbox的property值不能相同,如下
form:
这样就可以让提交之后出现错误信息之后多选框不被置空,而是原先选中什么现在还选中什么的状态
黑色头发 http://heisetoufa.iteye.com
<html:checkbox property="testBox1" value="chargeStat01">处罚开始</html:checkbox>
<html:checkbox property="testBox2" value="chargeStat01">处罚开始</html:checkbox>
form:
public class ChargeStatForm extends ActionForm {
private String testBox;
public String getTestBox() {
return testBox;
}
public void setTestBox(String testBox) {
this.chargeStatChargeItemInput="";
this.testBox = testBox;
}
}
这样就可以让提交之后出现错误信息之后多选框不被置空,而是原先选中什么现在还选中什么的状态
黑色头发 http://heisetoufa.iteye.com