title: Conditionally render element's attribute in a composite component
body: <p>I have the following composite component:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui:component xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:composite="http://java.sun.com/jsf/composite"&gt;
  
      &lt;composite:interface&gt;
          &lt;composite:attribute required="true" name="field" /&gt;
          &lt;composite:attribute required="true" name="value" /&gt;
          &lt;composite:attribute required="false" name="size"/&gt;
      &lt;/composite:interface&gt;
  
      &lt;composite:implementation&gt;
      ...
              &lt;div class="wrapper"&gt;
                  &lt;h:inputText value="#{cc.attrs.value}"
                      id="#{field.id}" 
                      rendered="#{field.rendered}" 
                      size="#{cc.attrs.size}"&gt;
                  &lt;/h:inputText&gt;
                  &lt;h:messages for="#{field.id}" styleClass="errorMessage"/&gt;
              &lt;/div&gt;
      ...
      &lt;/composite:implementation&gt;
  &lt;/ui:component&gt;
  </code></pre>
  
  <p>The problem is that when I'm using this component without setting its <code>size</code> attribute, it still gets rendered as <code>size=0</code> in the html input element. </p>
  
  <p>What I want is to render the nested <code>h:inputText</code>'s attribute only if it has a valid value (eg. not empty). Alternatively, I'd like to expose all attributes of the nested element if they are not overridden explicitly.</p>
  
  <p>How would it be possible?</p>