* @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
* javax.faces.component.UIComponent)
*/
public void apply(FaceletContext ctxObj, UIComponent parent)
throws IOException {
FaceletContextImplBase ctx = (FaceletContextImplBase) ctxObj;
if (this.template != null) {
VariableMapper orig = ctx.getVariableMapper();
if (this.params != null) {
VariableMapper vm = new VariableMapperWrapper(orig);
ctx.setVariableMapper(vm);
for (int i = 0; i < this.params.length; i++) {
this.params[i].apply(ctx, parent);
}
}
ctx.extendClient(this);
String path = null;
try {
path = this.template.getValue(ctx);
ctx.includeFacelet(parent, path);
} catch (IOException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, e.toString(), e);
}
throw new TagAttributeException(this.tag, this.template, "Invalid path : " + path);
} finally {
ctx.popClient(this);
ctx.setVariableMapper(orig);
}
} else {
this.nextHandler.apply(ctx, parent);
}
}