title: Duplicate ID exception when using <c:if> with composite component
body: <p>I get a duplicate ID exception when using composite components conditionally with <code>&lt;c:if&gt;</code> 
  I'm aware of this compile/render time issue but i have really no clue why the example below does not work.
  Please have a look at the following three simple snippets</p>
  
  <p>A session scoped bean named <strong>TestBean</strong> which holds a boolean value and two ajax listeners which change this value to true or false:</p>
  
  <pre><code>@Named
  @SessionScoped
  public class TestBean implements Serializable {
  
      private boolean isVisible = false;
  
      public void onSetItemVisible(AjaxBehaviorEvent e) {
          this.isVisible = true;
      }
  
      public void onSetItemInvisible(AjaxBehaviorEvent e) {
          this.isVisible = false;
      }
  
      public boolean isItemVisible()  {
          return this.isVisible;
      }
  }
  </code></pre>
  
  <p>A really simple composite component named <strong>testCmp</strong>:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:cc="http://java.sun.com/jsf/composite"&gt;
  
      &lt;cc:interface/&gt;
      &lt;cc:implementation&gt;
          &lt;h:outputText id="text" value="text"/&gt;
       &lt;/cc:implementation&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And a view page which allows switching between hide/show this composite component</p>
  
  <pre><code>&lt;h:body&gt;
      &lt;h:form id="testForm"&gt;
  
          &lt;c:if test="#{testBean.itemVisible}"&gt;
              &lt;test:testCmp id="test1"/&gt;
          &lt;/c:if&gt;
          &lt;p/&gt;
  
          &lt;test:testCmp id="test2"/&gt;
          &lt;p/&gt;
  
          &lt;!-- show/hide dynamic item --&gt;
          &lt;h:commandLink value="Show Item"&gt;
              &lt;f:ajax execute="@this" listener="#{testBean.onSetItemVisible}" render="@form"/&gt; 
          &lt;/h:commandLink&gt;
          &lt;br/&gt;
          &lt;h:commandLink value="Hide Item"&gt;
              &lt;f:ajax execute="@this" listener="#{testBean.onSetItemInvisible}" render="@form"/&gt;
          &lt;/h:commandLink&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p>The thing is: i get a duplicate ID Exception when i switch between show/hide.
  Exception says: <strong>"Component ID testForm:test2:text has already been found in the view"</strong></p>
  
  <p>It complains about 'test2' ... the component which is not conditionally added.
  And when i don't use a composite component and replace it with a standard component like <code>&lt;h:outputText&gt;</code> then anything works well.
  To reproduce the error it is important, that the composite component is used two times at the same page, one times with and the other times without the condition.</p>
  
  <p>After further searching i found another guy which i think has the same problem like me. But his example looks a bit more complex and is harder to reproduce.
  <a href="https://stackoverflow.com/questions/33258296/duplicate-component-id-in-jsf-using-composite-component-twice-in-view">Duplicate component ID in JSF using composite component twice in view</a></p>
  
  <p>Anybody has a clue whats going on here?
  My setup is JBoss EAP7 with Mojarra JSF 2.2.14 (but i tested with JSF 2.3.0-m11 too)
  Can someone can confirm this problem?
  If so i'll create a bug for the mojarray guys.</p>