1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.RewriteTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 36 public class ELRewriteTag extends RewriteTag { 37 38 42 private String actionExpr; 43 47 private String moduleExpr; 48 52 private String anchorExpr; 53 57 private String forwardExpr; 58 62 private String hrefExpr; 63 67 private String nameExpr; 68 72 private String pageExpr; 73 77 private String paramIdExpr; 78 82 private String paramNameExpr; 83 87 private String paramPropertyExpr; 88 92 private String paramScopeExpr; 93 97 private String propertyExpr; 98 102 private String scopeExpr; 103 107 private String transactionExpr; 108 112 private String useLocalEncodingExpr; 113 114 118 public String getActionExpr() { return (actionExpr); } 119 123 public String getModuleExpr() { return (moduleExpr); } 124 128 public String getAnchorExpr() { return (anchorExpr); } 129 133 public String getForwardExpr() { return (forwardExpr); } 134 138 public String getHrefExpr() { return (hrefExpr); } 139 143 public String getNameExpr() { return (nameExpr); } 144 148 public String getPageExpr() { return (pageExpr); } 149 153 public String getParamIdExpr() { return (paramIdExpr); } 154 158 public String getParamNameExpr() { return (paramNameExpr); } 159 163 public String getParamPropertyExpr() { return (paramPropertyExpr); } 164 168 public String getParamScopeExpr() { return (paramScopeExpr); } 169 173 public String getPropertyExpr() { return (propertyExpr); } 174 178 public String getScopeExpr() { return (scopeExpr); } 179 183 public String getTransactionExpr() { return (transactionExpr); } 184 188 public String getUseLocalEncodingExpr() { return (useLocalEncodingExpr); } 189 190 194 public void setActionExpr(String actionExpr) { this.actionExpr = actionExpr; } 195 199 public void setModuleExpr(String moduleExpr) { this.moduleExpr = moduleExpr; } 200 204 public void setAnchorExpr(String anchorExpr) { this.anchorExpr = anchorExpr; } 205 209 public void setForwardExpr(String forwardExpr) { this.forwardExpr = forwardExpr; } 210 214 public void setHrefExpr(String hrefExpr) { this.hrefExpr = hrefExpr; } 215 219 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 220 224 public void setPageExpr(String pageExpr) { this.pageExpr = pageExpr; } 225 229 public void setParamIdExpr(String paramIdExpr) { this.paramIdExpr = paramIdExpr; } 230 234 public void setParamNameExpr(String paramNameExpr) { this.paramNameExpr = paramNameExpr; } 235 239 public void setParamPropertyExpr(String paramPropertyExpr) { this.paramPropertyExpr = paramPropertyExpr; } 240 244 public void setParamScopeExpr(String paramScopeExpr) { this.paramScopeExpr = paramScopeExpr; } 245 249 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 250 254 public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; } 255 259 public void setTransactionExpr(String transactionExpr) { this.transactionExpr = transactionExpr; } 260 264 public void setUseLocalEncodingExpr(String useLocalEncodingExpr) { this.useLocalEncodingExpr = useLocalEncodingExpr; } 265 266 269 public void release() 270 { 271 super.release(); 272 setActionExpr(null); 273 setModuleExpr(null); 274 setAnchorExpr(null); 275 setForwardExpr(null); 276 setHrefExpr(null); 277 setNameExpr(null); 278 setPageExpr(null); 279 setParamIdExpr(null); 280 setParamNameExpr(null); 281 setParamPropertyExpr(null); 282 setParamScopeExpr(null); 283 setPropertyExpr(null); 284 setScopeExpr(null); 285 setTransactionExpr(null); 286 setUseLocalEncodingExpr(null); 287 } 288 289 294 public int doStartTag() throws JspException { 295 evaluateExpressions(); 296 return(super.doStartTag()); 297 } 298 299 305 private void evaluateExpressions() throws JspException { 306 String string = null; 307 Boolean bool = null; 308 309 if ((string = EvalHelper.evalString("action", getActionExpr(), 310 this, pageContext)) != null) 311 setAction(string); 312 313 if ((string = EvalHelper.evalString("module", getModuleExpr(), 314 this, pageContext)) != null) 315 setModule(string); 316 317 if ((string = EvalHelper.evalString("anchor", getAnchorExpr(), 318 this, pageContext)) != null) 319 setAnchor(string); 320 321 if ((string = EvalHelper.evalString("forward", getForwardExpr(), 322 this, pageContext)) != null) 323 setForward(string); 324 325 if ((string = EvalHelper.evalString("href", getHrefExpr(), 326 this, pageContext)) != null) 327 setHref(string); 328 329 if ((string = EvalHelper.evalString("name", getNameExpr(), 330 this, pageContext)) != null) 331 setName(string); 332 333 if ((string = EvalHelper.evalString("page", getPageExpr(), 334 this, pageContext)) != null) 335 setPage(string); 336 337 if ((string = EvalHelper.evalString("paramId", getParamIdExpr(), 338 this, pageContext)) != null) 339 setParamId(string); 340 341 if ((string = EvalHelper.evalString("paramName", getParamNameExpr(), 342 this, pageContext)) != null) 343 setParamName(string); 344 345 if ((string = EvalHelper.evalString("paramProperty", getParamPropertyExpr(), 346 this, pageContext)) != null) 347 setParamProperty(string); 348 349 if ((string = EvalHelper.evalString("paramScope", getParamScopeExpr(), 350 this, pageContext)) != null) 351 setParamScope(string); 352 353 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 354 this, pageContext)) != null) 355 setProperty(string); 356 357 if ((string = EvalHelper.evalString("scope", getScopeExpr(), 358 this, pageContext)) != null) 359 setScope(string); 360 361 if ((bool = EvalHelper.evalBoolean("transaction", getTransactionExpr(), 362 this, pageContext)) != null) 363 setTransaction(bool.booleanValue()); 364 365 if ((bool = EvalHelper.evalBoolean("useLocalEncoding", getUseLocalEncodingExpr(), 366 this, pageContext)) != null) 367 setUseLocalEncoding(bool.booleanValue()); 368 } 369 } 370 | Popular Tags |