1 18 19 package org.apache.strutsel.taglib.tiles; 20 21 import org.apache.struts.taglib.tiles.PutTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 63 public class ELPutTag extends PutTag { 64 65 69 private String nameExpr; 70 74 private String valueExpr; 75 79 private String contentExpr; 80 84 private String directExpr; 85 89 private String typeExpr; 90 94 private String beanNameExpr; 95 99 private String beanPropertyExpr; 100 104 private String beanScopeExpr; 105 109 private String roleExpr; 110 111 115 public String getNameExpr() { return (nameExpr); } 116 120 public String getValueExpr() { return (valueExpr); } 121 125 public String getContentExpr() { return (contentExpr); } 126 130 public String getDirectExpr() { return (directExpr); } 131 135 public String getTypeExpr() { return (typeExpr); } 136 140 public String getBeanNameExpr() { return (beanNameExpr); } 141 145 public String getBeanPropertyExpr() { return (beanPropertyExpr); } 146 150 public String getBeanScopeExpr() { return (beanScopeExpr); } 151 155 public String getRoleExpr() { return (roleExpr); } 156 157 161 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 162 166 public void setValueExpr(String valueExpr) { this.valueExpr = valueExpr; } 167 171 public void setContentExpr(String contentExpr) { this.contentExpr = contentExpr; } 172 176 public void setDirectExpr(String directExpr) { this.directExpr = directExpr; } 177 181 public void setTypeExpr(String typeExpr) { this.typeExpr = typeExpr; } 182 186 public void setBeanNameExpr(String beanNameExpr) { this.beanNameExpr = beanNameExpr; } 187 191 public void setBeanPropertyExpr(String beanPropertyExpr) { this.beanPropertyExpr = beanPropertyExpr; } 192 196 public void setBeanScopeExpr(String beanScopeExpr) { this.beanScopeExpr = beanScopeExpr; } 197 201 public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; } 202 203 206 public void release() 207 { 208 super.release(); 209 setNameExpr(null); 210 setValueExpr(null); 211 setContentExpr(null); 212 setDirectExpr(null); 213 setTypeExpr(null); 214 setBeanNameExpr(null); 215 setBeanPropertyExpr(null); 216 setBeanScopeExpr(null); 217 setRoleExpr(null); 218 } 219 220 225 public int doStartTag() throws JspException { 226 evaluateExpressions(); 227 return (super.doStartTag()); 228 } 229 230 236 private void evaluateExpressions() throws JspException { 237 String string = null; 238 239 if ((string = EvalHelper.evalString("name", getNameExpr(), 240 this, pageContext)) != null) 241 setName(string); 242 if ((string = EvalHelper.evalString("value", getValueExpr(), 243 this, pageContext)) != null) 244 setValue(string); 245 if ((string = EvalHelper.evalString("content", getContentExpr(), 246 this, pageContext)) != null) 247 setContent(string); 248 if ((string = EvalHelper.evalString("direct", getDirectExpr(), 249 this, pageContext)) != null) 250 setDirect(string); 251 if ((string = EvalHelper.evalString("type", getTypeExpr(), 252 this, pageContext)) != null) 253 setType(string); 254 if ((string = EvalHelper.evalString("beanName", getBeanNameExpr(), 255 this, pageContext)) != null) 256 setBeanName(string); 257 if ((string = EvalHelper.evalString("beanProperty", getBeanPropertyExpr(), 258 this, pageContext)) != null) 259 setBeanProperty(string); 260 if ((string = EvalHelper.evalString("beanScope", getBeanScopeExpr(), 261 this, pageContext)) != null) 262 setBeanScope(string); 263 if ((string = EvalHelper.evalString("role", getRoleExpr(), 264 this, pageContext)) != null) 265 setRole(string); 266 } 267 } 268 | Popular Tags |