TemplateClient client = new TemplateClient() {
public boolean apply(FaceletContext ctx, UIComponent parent, String name) throws IOException {
return applyTemplate(ctx, parent, name);
}
};
faceletContextImpl.pushClient(client);
try {
ctx.includeFacelet(parent, templatePath);
} finally {
faceletContextImpl.popClient(client);
faceletContextImpl.setVariableMapper(originalVariableMapper);