1 18 19 package org.apache.strutsel.taglib.tiles; 20 21 import org.apache.struts.taglib.tiles.InsertTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 38 public class ELInsertTag extends InsertTag { 39 40 44 private String templateExpr; 45 49 private String componentExpr; 50 54 private String pageExpr; 55 59 private String definitionExpr; 60 64 private String attributeExpr; 65 69 private String nameExpr; 70 74 private String beanNameExpr; 75 79 private String beanPropertyExpr; 80 84 private String beanScopeExpr; 85 89 private String flushExpr; 90 94 private String ignoreExpr; 95 99 private String roleExpr; 100 104 private String controllerUrlExpr; 105 109 private String controllerClassExpr; 110 111 115 public String getTemplateExpr() { return (templateExpr); } 116 120 public String getComponentExpr() { return (componentExpr); } 121 125 public String getPageExpr() { return (pageExpr); } 126 130 public String getDefinitionExpr() { return (definitionExpr); } 131 135 public String getAttributeExpr() { return (attributeExpr); } 136 140 public String getNameExpr() { return (nameExpr); } 141 145 public String getBeanNameExpr() { return (beanNameExpr); } 146 150 public String getBeanPropertyExpr() { return (beanPropertyExpr); } 151 155 public String getBeanScopeExpr() { return (beanScopeExpr); } 156 160 public String getFlushExpr() { return (flushExpr); } 161 165 public String getIgnoreExpr() { return (ignoreExpr); } 166 170 public String getRoleExpr() { return (roleExpr); } 171 175 public String getControllerUrlExpr() { return (controllerUrlExpr); } 176 180 public String getControllerClassExpr() { return (controllerClassExpr); } 181 182 186 public void setTemplateExpr(String templateExpr) { this.templateExpr = templateExpr; } 187 191 public void setComponentExpr(String componentExpr) { this.componentExpr = componentExpr; } 192 196 public void setPageExpr(String pageExpr) { this.pageExpr = pageExpr; } 197 201 public void setDefinitionExpr(String definitionExpr) { this.definitionExpr = definitionExpr; } 202 206 public void setAttributeExpr(String attributeExpr) { this.attributeExpr = attributeExpr; } 207 211 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 212 216 public void setBeanNameExpr(String beanNameExpr) { this.beanNameExpr = beanNameExpr; } 217 221 public void setBeanPropertyExpr(String beanPropertyExpr) { this.beanPropertyExpr = beanPropertyExpr; } 222 226 public void setBeanScopeExpr(String beanScopeExpr) { this.beanScopeExpr = beanScopeExpr; } 227 231 public void setFlushExpr(String flushExpr) { this.flushExpr = flushExpr; } 232 236 public void setIgnoreExpr(String ignoreExpr) { this.ignoreExpr = ignoreExpr; } 237 241 public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; } 242 246 public void setControllerUrlExpr(String controllerUrlExpr) { this.controllerUrlExpr = controllerUrlExpr; } 247 251 public void setControllerClassExpr(String controllerClassExpr) { this.controllerClassExpr = controllerClassExpr; } 252 253 256 public void release() 257 { 258 super.release(); 259 setTemplateExpr(null); 260 setComponentExpr(null); 261 setPageExpr(null); 262 setDefinitionExpr(null); 263 setAttributeExpr(null); 264 setNameExpr(null); 265 setBeanNameExpr(null); 266 setBeanPropertyExpr(null); 267 setBeanScopeExpr(null); 268 setFlushExpr(null); 269 setIgnoreExpr(null); 270 setRoleExpr(null); 271 setControllerUrlExpr(null); 272 setControllerClassExpr(null); 273 } 274 275 280 public int doStartTag() throws JspException { 281 evaluateExpressions(); 282 return (super.doStartTag()); 283 } 284 285 291 private void evaluateExpressions() throws JspException { 292 String string = null; 293 Boolean bool = null; 294 295 if ((string = EvalHelper.evalString("template", getTemplateExpr(), 296 this, pageContext)) != null) 297 setTemplate(string); 298 if ((string = EvalHelper.evalString("component", getComponentExpr(), 299 this, pageContext)) != null) 300 setComponent(string); 301 if ((string = EvalHelper.evalString("page", getPageExpr(), 302 this, pageContext)) != null) 303 setPage(string); 304 if ((string = EvalHelper.evalString("definition", getDefinitionExpr(), 305 this, pageContext)) != null) 306 setDefinition(string); 307 if ((string = EvalHelper.evalString("attribute", getAttributeExpr(), 308 this, pageContext)) != null) 309 setAttribute(string); 310 if ((string = EvalHelper.evalString("name", getNameExpr(), 311 this, pageContext)) != null) 312 setName(string); 313 if ((string = EvalHelper.evalString("beanName", getBeanNameExpr(), 314 this, pageContext)) != null) 315 setBeanName(string); 316 if ((string = EvalHelper.evalString("beanProperty", getBeanPropertyExpr(), 317 this, pageContext)) != null) 318 setBeanProperty(string); 319 if ((string = EvalHelper.evalString("beanScope", getBeanScopeExpr(), 320 this, pageContext)) != null) 321 setBeanScope(string); 322 if ((string = EvalHelper.evalString("flush", getFlushExpr(), 323 this, pageContext)) != null) 324 setFlush(string); 325 if ((bool = EvalHelper.evalBoolean("ignore", getIgnoreExpr(), 326 this, pageContext)) != null) 327 setIgnore(bool.booleanValue()); 328 if ((string = EvalHelper.evalString("role", getRoleExpr(), 329 this, pageContext)) != null) 330 setRole(string); 331 if ((string = EvalHelper.evalString("controllerUrl", getControllerUrlExpr(), 332 this, pageContext)) != null) 333 setControllerUrl(string); 334 if ((string = EvalHelper.evalString("controllerClass", getControllerClassExpr(), 335 this, pageContext)) != null) 336 setControllerClass(string); 337 } 338 } 339 | Popular Tags |