title: Struts 2 checkbox : What's the use of the value attribute when the fieldValue can only be true or false?
body: <ul>
  <li><p>Why do we need a <strong>value</strong> attribute as well as a <strong>fieldValue</strong> attribute in <code>s:checkbox</code> tag, unlike <code>s:textfield</code>, which has only the <strong>value</strong> attribute ?</p></li>
  <li><p>Does the <code>s:checkbox</code> tag's <code>fieldValue</code> attribute allow strings other than "<strong>true</strong>" or "<strong>false</strong>" ?
  In Struts2 in Action (Manning) , it says about the <code>fieldValue</code> attribute </p></li>
  </ul>
  
  <blockquote>
    <p>The actual value that’ll be submitted by the checkbox. Maybe true or
    false</p>
  </blockquote>
  
  <p>That is, if I use </p>
  
  <p><code>&lt;s:checkbox name="wantMoreChocolates" fieldValue="true"/&gt;</code></p>
  
  <p>then <strong>wantMoreChocolate</strong> can only be Boolean type in the java class. In that case, <strong>why do the docs specify the type of fieldValue to be a String and not Boolean</strong> ?</p>
  
  <ul>
  <li>Moreover, about the value property, it says </li>
  </ul>
  
  <blockquote>
    <p>the value attribute, as with the other UI components, points to the
    actual Java-side property to which the component is bound, a Boolean
    in this case.</p>
  </blockquote>
  
  <p>If through "<strong>value</strong>" we specify the actual property to which the component is bound, <strong>then what's the role of the name attribute</strong>. Since, the name attribute has to point to a Boolean value, why does it have to use the value attribute to bind it to another boolean ?</p>
  
  <ul>
  <li>Why can't prepopulation occur solely on the basis of the property corresponding to the name attribute</li>
  </ul>