struts复选框:取消选择并提交

时间:2014-02-20 13:49:47

标签: html struts

在我的JSP页面中,我有:

<nested:checkbox property="product.hasEmployee" />

默认情况下,当我取消选中此复选框时,会选中此复选框 我提交页面,我发现它已被选中!

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

在服务器端执行此代码:

if (request.getParameter("product.hasEmployee") == null) {
     product.setHasEmployee(false);
}