Struts2 – checkbox tag example, check box example

checkbox struts 2 example
check box in struts2 is stateful mean we can get default selected check box with defining in checkbox tag. check box use with list option where can define value and id of the checkbox option.

Example will show you how to use check box in struts2

<s:checkboxlist name="smonth" list="#{'1':'Jan','2':'Feb','3':'Mar'}" value="2" />

  • 1. list will set checkbox with value and label
  • 2. value is attribute which set default selected value of option in check box, if we set 2 value it will automatically selected Feb month checkbox

Tags:

Bookmark  

 

Leave a Reply

Security Code:

 

  Random Post