1 18 19 package org.apache.strutsel.taglib.tiles; 20 21 import org.apache.struts.taglib.tiles.AddTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 37 public class ELAddTag extends AddTag { 38 39 43 private String valueExpr; 44 48 private String contentExpr; 49 53 private String directExpr; 54 58 private String typeExpr; 59 63 private String beanNameExpr; 64 68 private String beanPropertyExpr; 69 73 private String beanScopeExpr; 74 78 private String roleExpr; 79 80 84 public String getValueExpr() { return (valueExpr); } 85 89 public String getContentExpr() { return (contentExpr); } 90 94 public String getDirectExpr() { return (directExpr); } 95 99 public String getTypeExpr() { return (typeExpr); } 100 104 public String getBeanNameExpr() { return (beanNameExpr); } 105 109 public String getBeanPropertyExpr() { return (beanPropertyExpr); } 110 114 public String getBeanScopeExpr() { return (beanScopeExpr); } 115 119 public String getRoleExpr() { return (roleExpr); } 120 121 125 public void setValueExpr(String valueExpr) { this.valueExpr = valueExpr; } 126 130 public void setContentExpr(String contentExpr) { this.contentExpr = contentExpr; } 131 135 public void setDirectExpr(String directExpr) { this.directExpr = directExpr; } 136 140 public void setTypeExpr(String typeExpr) { this.typeExpr = typeExpr; } 141 145 public void setBeanNameExpr(String beanNameExpr) { this.beanNameExpr = beanNameExpr; } 146 150 public void setBeanPropertyExpr(String beanPropertyExpr) { this.beanPropertyExpr = beanPropertyExpr; } 151 155 public void setBeanScopeExpr(String beanScopeExpr) { this.beanScopeExpr = beanScopeExpr; } 156 160 public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; } 161 162 165 public void release() 166 { 167 super.release(); 168 setValueExpr(null); 169 setContentExpr(null); 170 setDirectExpr(null); 171 setTypeExpr(null); 172 setBeanNameExpr(null); 173 setBeanPropertyExpr(null); 174 setBeanScopeExpr(null); 175 setRoleExpr(null); 176 } 177 178 183 public int doStartTag() throws JspException { 184 evaluateExpressions(); 185 return (super.doStartTag()); 186 } 187 188 194 private void evaluateExpressions() throws JspException { 195 String string = null; 196 197 if ((string = EvalHelper.evalString("value", getValueExpr(), 198 this, pageContext)) != null) 199 setValue(string); 200 if ((string = EvalHelper.evalString("content", getContentExpr(), 201 this, pageContext)) != null) 202 setContent(string); 203 if ((string = EvalHelper.evalString("direct", getDirectExpr(), 204 this, pageContext)) != null) 205 setDirect(string); 206 if ((string = EvalHelper.evalString("type", getTypeExpr(), 207 this, pageContext)) != null) 208 setType(string); 209 if ((string = EvalHelper.evalString("beanName", getBeanNameExpr(), 210 this, pageContext)) != null) 211 setBeanName(string); 212 if ((string = EvalHelper.evalString("beanProperty", getBeanPropertyExpr(), 213 this, pageContext)) != null) 214 setBeanProperty(string); 215 if ((string = EvalHelper.evalString("beanScope", getBeanScopeExpr(), 216 this, pageContext)) != null) 217 setBeanScope(string); 218 if ((string = EvalHelper.evalString("role", getRoleExpr(), 219 this, pageContext)) != null) 220 setRole(string); 221 } 222 } 223 | Popular Tags |