FaceletViewDeclarationLanguage vdl = (FaceletViewDeclarationLanguage)
facesContext.getApplication().getViewHandler().getViewDeclarationLanguage(
facesContext, facesContext.getViewRoot().getViewId());
Facelet componentFacelet;
FaceletFactory faceletFactory = vdl.getFaceletFactory();
FaceletFactory.setInstance(faceletFactory);
try
{
componentFacelet
= faceletFactory.compileComponentFacelet(taglibURI, tagName, attributes);
}
finally
{
FaceletFactory.setInstance(null);
}