title: Why does a JSF required validation error replace input field with its original value
body: <p>Using JSF 2.0:</p>
  
  <p>User loads a page with an input field that is bound to a backing bean field that has an existing value. The input field has been marked as required. If the user then blanks out the field and submits the form, the required message appears, as expected, however the value of the field is replaced with its original value when the page was rendered rather than leaving the field blank. </p>
  
  <p>This behavior appears inconsistent with what happens when there is a format validation error on a field (vs a required validation error) e.g. if there is a field for a user to enter an email address on the page which is linked to an email format validator and the user replaces an existing valid email address that was populated in the field when the page was loaded with an invalid email address and submits the form, the validation error message appears and the current value of the email address field is left alone  (and not replaced with its original value when the page was loaded). </p>
  
  <p>Is there any way to leave the field as blank when a required field validation error occurs versus re-loading its original (non-blank) value?</p>
  
  <p>More details:</p>
  
  <ul>
  <li>Weblogic 10.3.2</li>
  <li>MyFaces 2.0.12</li>
  </ul>
  
  <p>JSF page:</p>
  
  <pre><code>&lt;h:form&gt;
    &lt;h:messages showSummary="true"/&gt;
    &lt;h:inputText value="#{page1Controller.firstName}" 
                 required="true" 
                 requiredMessage="You must enter a first name"/&gt;
    &lt;h:commandButton value="Submit"/&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Managed Bean</p>
  
  <pre><code>@ManagedBean
  public class Page1Controller
  {
  
      public String getFirstName()
      {
          return "Default Value";
      }
  
      public void setFirstName(String value)
      {
          // no-op (for example purposes only)
      }
  
  }
  </code></pre>