CheckBoxList label
This tab can create multiple check boxes at once, which are based on the collection specified by the List property
To generate multiple check boxes and use common properties.
This label has two common properties: Listkey: The value that specifies a property in the collection element as a check box. If the collection is a map, you can use Key-value, respectively, for the key-value of the map as the value of the check box. ListValue: A label that specifies a property in the collection element as a check box. If the collection is a map, you can use Key-value to label the Key-value of the map respectively as a check box.
eg
<s:form>
<!--use a simple collection to generate multiple check boxes;
<s:checkboxlist name= "a" label= "Please select your favorite book"
labelposition= "Top" list= "{' Struts2 authoritative guide ',
' Lightweight Java Business application ', ' Ajax treasure based on Java EE '}"/>
<!-- Use a simple Map object to generate more than one check box
Use the value of the Map object's key (book title) As the check box,
Use the value of the Map object (publication time) as the label for the check box;
<s: CheckBoxList name= "B" label= "Please select the publication date you want to select"
labelposition= "Top" list= "#{' Struts2 authoritative guide ': ' October 2007 ',
' Lightweight Java Business application ': ' 2007 month April ',
' Ajax treasure based on Java EE ': ' June 2007 '} '
listkey= ' key '
Listvalue= "Value"/>
<!--creates a JavaBean object and puts it into the stack context;
<s:bean name= "Lee. Bookservice "id=" BS/>
<!--use multiple JavaBean instances in a collection to generate multiple check boxes
Use the Name property in the collection element as the label for the check box
Value-->
<s:checkboxlist name= "B" label= "Please choose your favorite book"
labelposition= "top" using the Author property as the checkbox in the collection element;
list= #bs. Books
listkey= "author"
listvalue= "name"/>
</s:form>