1 14 15 package com.sun.facelets.tag.ui; 16 17 import java.io.IOException ; 18 19 import javax.el.ELException; 20 import javax.el.VariableMapper; 21 import javax.faces.FacesException; 22 import javax.faces.component.UIComponent; 23 24 import com.sun.facelets.FaceletContext; 25 import com.sun.facelets.FaceletException; 26 import com.sun.facelets.el.VariableMapperWrapper; 27 import com.sun.facelets.tag.TagAttribute; 28 import com.sun.facelets.tag.TagConfig; 29 import com.sun.facelets.tag.TagHandler; 30 31 35 public final class IncludeHandler extends TagHandler { 36 37 private final TagAttribute src; 38 39 42 public IncludeHandler(TagConfig config) { 43 super(config); 44 this.src = this.getRequiredAttribute("src"); 45 } 46 47 53 public void apply(FaceletContext ctx, UIComponent parent) 54 throws IOException , FacesException, FaceletException, ELException { 55 String path = this.src.getValue(ctx); 56 VariableMapper orig = ctx.getVariableMapper(); 57 ctx.setVariableMapper(new VariableMapperWrapper(orig)); 58 try { 59 this.nextHandler.apply(ctx, null); 60 ctx.includeFacelet(parent, path); 61 } finally { 62 ctx.setVariableMapper(orig); 63 } 64 } 65 } 66 | Popular Tags |