Struts tag library HTML: MultiBox's use
The label of
There is a problem that you can't understand: Why can I use the arraylist type parameter when displaying, but the submission always reports wrong? strange!
The following is to reference other:
If this check box is not selected, the browser will not submit a value for this control. Instead, if selected, the Name of this control will be submitted. This behavior is why there is a reset () method in Actionform. Because the browser never marks the checkbox without being selected, the only solution of all Boxes is to check if the Boxes exists in Request. The MultiBox control is designed to use an array of String. Each element of it represents a Checked Box. In order to check a Box, add a String type Box value to this array, delete the elements in the data for those who are not selected. When passing a value, the Element in the MultiBox control scanned array see if it matches. If you match, the box is selected, otherwise, Box is not selected. If the user selects BOX and then submits the FORM, the value of this BOX will be included in the request. The control will add this Box to the selected array. If there is no thing being selected, there will be no things submitted, and there is no thing that will be added to the selected array. If the Actionform Bean still maintains session contezt, in two request pieces, the reset () method needs to set the length of the selected array to 0 (but this array itself is not null) example
String [] s = new string [];