Struts2 – Radio button tag example, radiobutton example

Radio button struts 2 example
radio button in struts2 is stateful mean we can get default selected radio button with defining in radio button tag with value attribute. Radio button can be use with list attribute where can define value and label of the radio button.

Example will show you how to use radio button in struts2

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

  • 1. list will set radio button with value and label
  • 2. value is attribute which set default selected value of radio button, if we set 2 value it will automatically selected Feb month radiobutton

Tags:

Bookmark  

 

Leave a Reply

Security Code:

 

  Random Post