1 14 15 package com.sun.facelets.tag.jstl.core; 16 17 import java.io.IOException ; 18 19 import javax.el.ELException; 20 import javax.faces.FacesException; 21 import javax.faces.component.UIComponent; 22 23 import com.sun.facelets.FaceletContext; 24 import com.sun.facelets.tag.TagAttribute; 25 import com.sun.facelets.tag.TagConfig; 26 import com.sun.facelets.tag.TagHandler; 27 28 32 public final class IfHandler extends TagHandler { 33 34 private final TagAttribute test; 35 36 private final TagAttribute var; 37 38 41 public IfHandler(TagConfig config) { 42 super(config); 43 this.test = this.getRequiredAttribute("test"); 44 this.var = this.getAttribute("var"); 45 } 46 47 public void apply(FaceletContext ctx, UIComponent parent) 48 throws IOException , FacesException, ELException { 49 boolean b = this.test.getBoolean(ctx); 50 if (this.var != null) { 51 ctx.setAttribute(var.getValue(ctx), new Boolean (b)); 52 } 53 if (b) { 54 this.nextHandler.apply(ctx, parent); 55 } 56 } 57 58 } 59 | Popular Tags |