Created a TagHandler and added a facelet. The facelet content is still not evaluated. The html code contains ui:fragment text.
@Override public void encodeBegin(FacesContext context) throws IOException{ ResponseWriter writer = context.getResponseWriter(); content = benefits.getContent(type); writer.write(content); } <content type="short"> <data><![CDATA[ <ui:fragment rendered="#{true}"> <a id="" href="a.xhtml> </ui:fragment> <ui:fragment rendered="{false}"> <a id="" href="b.xhtml"> </ui:fragment> <img src="a.png" alt="" /> </a> ]]></data> public class CardHolderBenefitsTagHandler extends TagHandler { private final TagAttribute src; public CardHolderBenefitsTagHandler(TagConfig config) { super(config); TagAttribute attr = null; attr = this.getAttribute("src"); this.src = attr; } public void apply(FaceletContext ctx, UIComponent parent) throws IOException { String path = this.src.getValue(ctx); VariableMapper orig = ctx.getVariableMapper(); ctx.setVariableMapper(new VariableMapperWrapper(orig)); try { this.nextHandler.apply(ctx, null); ctx.includeFacelet(parent, path); } catch (IOException e) { throw new TagAttributeException(this.tag, this.src, "Invalid path : " + path); } finally { ctx.setVariableMapper(orig); } } }