I have dynamic number of checkboxes in jsp page as given below.
Because your checkboxes are all named the same (checkbox), Struts2 is just passing the following:
checkbox=true&checkbox=true&checkbox=true
Does that mean that you omitted the second, third, or fourth checkbox?
What you actually want is not an array of booleans, but a map of Integer to Boolean. Here's an example:
public class MyAction extends ActionSupport {
private Map checkboxes;
...
public Map getCheckboxes() {
return checkboxes;
}
public void setCheckboxes(Map checkboxes) {
this.checkboxes = checkboxes;
}
}
<%-- this outputs checkboxes[0], checkboxes[1], etc. --%>