Question

In my JSP page I have:

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

This checkbox is selected by default, when I deselect it then I submit the page, I find it selected !

how can I resolve this problem?

Était-ce utile?

La solution

Execute this code in the server side:

if (request.getParameter("product.hasEmployee") == null) {
     product.setHasEmployee(false);
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top