title: UIInput values inside cc:insertChildren are not redisplayed after validation failure
body: <p><strong>Update:</strong> Updated once more now. I think my previous analysis was wrong, because I have now been able to create an example for this. It appears to be related to composite components and the insertChildren tag.</p>
  
  <p>Here is my facelet:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:form="http://java.sun.com/jsf/composite/composite/form"
      xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
  
  &lt;h:head&gt;&lt;/h:head&gt;
  
  &lt;h:body&gt;
          &lt;h:form&gt;
          &lt;form:workspace&gt;
  
              &lt;h:inputText id="email" value="#{user.email}" size="45"
                  required="true" requiredMessage="Required"&gt;
                  &lt;f:validateRegex pattern="([^.@]+)(\.[^.@]+)*@([^.@]+\.)+([^.@]+)" /&gt;
              &lt;/h:inputText&gt;
              &lt;h:message for="email" /&gt;
              &lt;br /&gt;
              &lt;h:commandButton action="#{user.update}" value="Update"/&gt;
  
          &lt;/form:workspace&gt;
          &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The form:workspace composite component is defined as follows:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:cc="http://java.sun.com/jsf/composite"&gt;
  
  &lt;cc:interface&gt;
  &lt;/cc:interface&gt;
  
  &lt;cc:implementation&gt;
      &lt;cc:insertChildren/&gt;
  &lt;/cc:implementation&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The <code>#{user}</code> variable refers to a trivial bean with just a field called email and a getter and a setter. The update method does nothing.</p>
  
  <p>The behavior I get is as described below. When I enter an invalid value, it is reverted back to what it is stored in the bean. If I remove the wrapping by the form:workspace component, it works like I expect - the value is not reverted. JSF bug?</p>
  
  <hr>
  
  <p>I have a JSF form with a number of input components. Some of these have validators attached to them. For example, a simple one is the e-mail address, which is mandatory:</p>
  
  <pre><code>&lt;h:inputText id="email" value="#{profile.user.email}" size="45"
    required="true" requiredMessage="Required"&gt;
  </code></pre>
  
  <p>Now, we have received a requirement that fields that are invalid should keep the submitted value in them, so the user does not have retype a lot of text for simple spelling mistakes. This seems very reasonable to me, and I even expected this to be the default behavior of validation. But it doesn't seem to be - the value is reverted back to what it was before (when it was still valid).</p>
  
  <p>The problem is, I cannot even find a reference for what the behavior should be. I read somewhere that it's the local value of the UIInput that is displayed after validation. Inspecting the code of UIInput tells me that local value is intentionally not set if validation fails. But this does not seem to be the whole truth, because ALL input fields are reverted - not just the ones for which validation failed! So it looks more like it gets the values from the model again.</p>
  
  <p>In any event, is there a way I circumvent this behavior?</p>
  
  <p>I am using JSF 2.0.4-b09. I feel like I am missing something obvious.</p>
  
  <p>Edit: I changed the e-mail validator to the regexp one BalusC posted below, and I still get the same behavior. I posted an image illustrating the problem. The upper part of the image shows the initial state of the form. Then the middle part shows that I change the fields "First name", "Last name" and "Email". The bottom part shows the result after I click the save button. As you can see, the e-mail field is reverted. Not only that, the first name and last name fields are also reverted.</p>
  
  <p><img src="https://i.stack.imgur.com/3PtVZ.jpg" alt="Problem illustrated in three steps."></p>