1 18 19 package org.apache.strutsel.taglib.tiles; 20 21 import org.apache.struts.taglib.tiles.UseAttributeTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 36 public class ELUseAttributeTag extends UseAttributeTag { 37 38 42 private String idExpr; 43 47 private String classnameExpr; 48 52 private String scopeExpr; 53 57 private String nameExpr; 58 62 private String ignoreExpr; 63 64 68 public String getIdExpr() { return (idExpr); } 69 73 public String getClassnameExpr() { return (classnameExpr); } 74 78 public String getScopeExpr() { return (scopeExpr); } 79 83 public String getNameExpr() { return (nameExpr); } 84 88 public String getIgnoreExpr() { return (ignoreExpr); } 89 90 94 public void setIdExpr(String idExpr) { this.idExpr = idExpr; } 95 99 public void setClassnameExpr(String classnameExpr) { this.classnameExpr = classnameExpr; } 100 104 public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; } 105 109 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 110 114 public void setIgnoreExpr(String ignoreExpr) { this.ignoreExpr = ignoreExpr; } 115 116 119 public void release() 120 { 121 super.release(); 122 setIdExpr(null); 123 setClassnameExpr(null); 124 setScopeExpr(null); 125 setNameExpr(null); 126 setIgnoreExpr(null); 127 } 128 129 134 public int doStartTag() throws JspException { 135 evaluateExpressions(); 136 return (super.doStartTag()); 137 } 138 139 145 private void evaluateExpressions() throws JspException { 146 String string = null; 147 Boolean bool = null; 148 149 if ((string = EvalHelper.evalString("id", getIdExpr(), 150 this, pageContext)) != null) 151 setId(string); 152 if ((string = EvalHelper.evalString("classname", getClassnameExpr(), 153 this, pageContext)) != null) 154 setClassname(string); 155 if ((string = EvalHelper.evalString("scope", getScopeExpr(), 156 this, pageContext)) != null) 157 setScope(string); 158 if ((string = EvalHelper.evalString("name", getNameExpr(), 159 this, pageContext)) != null) 160 setName(string); 161 if ((bool = EvalHelper.evalBoolean("ignore", getIgnoreExpr(), 162 this, pageContext)) != null) 163 setIgnore(bool.booleanValue()); 164 } 165 } 166 | Popular Tags |