title: Ways to include a dynamically generated facelet
body: <p>In current project I need to create a panel that will contain an HTML content created by the user elsewhere in the application. This content can be easily inserted like this:</p>
  
  <pre><code>&lt;h:outputText value="#{myBean.dynamicHTMLContent}" escape="false"/&gt;
  </code></pre>
  
  <p>An example content:</p>
  
  <pre><code>&lt;p&gt;User text&lt;/p&gt;
  </code></pre>
  
  <p>Now we need to give the user more freedom and allow him to use tokens in the HTML code that will be resolved by the application later:</p>
  
  <pre><code>&lt;p&gt;User text&lt;/p&gt;&lt;p&gt;User image: {niceImage}&lt;/p&gt;
  </code></pre>
  
  <p>The application parses user content in <em>myBean.dynamicHTMLContent</em> and replaces <em>{niceImage(param)}</em> with</p>
  
  <pre><code>&lt;a4j:mediaOutput element="img" createContent="{myBean.generateNiceImage}"/&gt;
  </code></pre>
  
  <p>This is already a facelet snippet and cannot be evaluated and rendered in <em>h:outputText</em>.</p>
  
  <p>I was looking for a good way to include this kind of dynamic content within a facelet at the stage when EL expressions are not yet evaluated. Something like</p>
  
  <pre><code>&lt;ui:include src="src"/&gt;
  </code></pre>
  
  <p>but for dynamic components would be the best solution.</p>
  
  <p>Any ideas? </p>