title: #{cc.attrs} in nested custom composite component
body: <p>In JSF 2.2, I have a custom component <code>y:parent</code> including another custom component <code>y:child</code>, which has a component java bean and which allows children.</p>
  
  <p>My problem is that <code>#{cc.attrs}</code> refers to the 'nearest' component, so if I make something like :</p>
  
  <pre><code>&lt;!-- y:parent --&gt;
  &lt;cc:implementation&gt;
      &lt;a id="#{cc.attrs.myAttribute.myProperty}" /&gt;
      &lt;y:child&gt;
          &lt;a id="#{cc.attrs.myAttribute.myProperty}" /&gt;
      &lt;/y:child&gt;
  &lt;/cc:implementation&gt;
  </code></pre>
  
  <p>The two <code>#{cc.attrs.myAttribute}</code> refers to the two components (first <code>y:parent</code>, then <code>y:child</code>), and not always <code>y:parent</code>, so the second access to parent attributes fails.</p>
  
  <p>Is there a way to tell JSF to still refer to the parent component?</p>
  
  <p>The only way I found is to use a <code>c:set</code> on the attribute I'm looking for, something like :</p>
  
  <pre><code>&lt;!-- y:parent --&gt;
  &lt;cc:implementation&gt;
      &lt;c:set var="myAttribute" value="#{cc.attrs.myAttribute}" /&gt;
      &lt;y:child&gt;
          &lt;a id="#{myAttribute.myProperty}" /&gt;
      &lt;/y:child&gt;
  &lt;/cc:implementation&gt;
  </code></pre>
  
  <p>Also, I discovered that EL evaluation are different for tag attribute and content, not sure why. I guess it depends on the JSF lifecycle. So, for example:</p>
  
  <pre><code>&lt;!-- y:parent --&gt;
  &lt;cc:implementation&gt;
      &lt;a id="#{cc.attrs.myAttribute.myProperty}"&gt;#{cc.attrs.myAttribute.myProperty}&lt;/a&gt;
      &lt;y:child&gt;
          &lt;a id="#{cc.attrs.myAttribute.myProperty}"&gt;#{cc.attrs.myAttribute.myProperty}&lt;/a&gt;
      &lt;/y:child&gt;
  &lt;/cc:implementation&gt;
  </code></pre>
  
  <p>The two links will have the same content, but only the first <code>id</code> will be set.</p>