title: How does the 'binding' attribute work in JSF? When and how should it be used?
body: <p>There are lot of materials out there differentiating <code>value</code> attribute and <code>binding</code> attribute in JSF.</p>
  
  <p>I'm interested in how both approaches differ from each other. Given:</p>
  
  <pre><code>public class User {
      private String name;
      private UICommand link;
  
      // Getters and setters omitted.
  }
  </code></pre>
  
  <pre class="lang-xhtml prettyprint-override"><code>&lt;h:form&gt;
      &lt;h:commandLink binding="#{user.link}" value="#{user.name}" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>It is pretty straight forward what happens when a <code>value</code> attribute is specified. The getter runs to return the <code>name</code> property value of the <code>User</code> bean. The value is printed to HTML output.</p>
  
  <p>But I couldn't understand how <code>binding</code> works. How does the generated HTML maintain a binding with the <code>link</code> property of the <code>User</code> bean?</p>
  
  <p>Below is the relevant part of the generated output after manual beautification and commenting (note that the id <code>j_id_jsp_1847466274_1</code> was auto-generated and that there are two hidden input widgets).
  I'm using Sun's JSF RI, version 1.2.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="/TestJSF/main.jsf" enctype="application/x-www-form-urlencoded"
      id="j_id_jsp_1847466274_1" method="post"  name="j_id_jsp_1847466274_1"&gt;
      &lt;input name="j_id_jsp_1847466274_1" type="hidden" value="j_id_jsp_1847466274_1"&gt;
      &lt;a href="#" onclick="..."&gt;Name&lt;/a&gt;
      &lt;input autocomplete="off" id="javax.faces.ViewState" name="javax.faces.ViewState"
          type="hidden" value="-908991273579182886:-7278326187282654551"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Where is the <code>binding</code> stored here?</p>