1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.FormTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 37 public class ELFormTag extends FormTag { 38 39 43 private String actionExpr; 44 48 private String disabledExpr; 49 53 private String enctypeExpr; 54 58 private String focusExpr; 59 63 private String focusIndexExpr; 64 68 private String methodExpr; 69 73 private String onresetExpr; 74 78 private String onsubmitExpr; 79 83 private String readonlyExpr; 84 88 private String scriptLanguageExpr; 89 93 private String styleExpr; 94 98 private String styleClassExpr; 99 103 private String styleIdExpr; 104 108 private String targetExpr; 109 113 private String acceptCharsetExpr; 114 115 119 public String getActionExpr() { return (actionExpr); } 120 124 public String getDisabledExpr() { return (disabledExpr); } 125 129 public String getEnctypeExpr() { return (enctypeExpr); } 130 134 public String getFocusExpr() { return (focusExpr); } 135 139 public String getFocusIndexExpr() { return (focusIndexExpr); } 140 144 public String getMethodExpr() { return (methodExpr); } 145 149 public String getOnresetExpr() { return (onresetExpr); } 150 154 public String getOnsubmitExpr() { return (onsubmitExpr); } 155 159 public String getReadonlyExpr() { return (readonlyExpr); } 160 164 public String getScriptLanguageExpr() { return (scriptLanguageExpr); } 165 169 public String getStyleExpr() { return (styleExpr); } 170 174 public String getStyleClassExpr() { return (styleClassExpr); } 175 179 public String getStyleIdExpr() { return (styleIdExpr); } 180 184 public String getTargetExpr() { return (targetExpr); } 185 189 public String getAcceptCharsetExpr() { return (acceptCharsetExpr); } 190 191 195 public void setActionExpr(String actionExpr) { this.actionExpr = actionExpr; } 196 200 public void setDisabledExpr(String disabledExpr) { this.disabledExpr = disabledExpr; } 201 205 public void setEnctypeExpr(String enctypeExpr) { this.enctypeExpr = enctypeExpr; } 206 210 public void setFocusExpr(String focusExpr) { this.focusExpr = focusExpr; } 211 215 public void setFocusIndexExpr(String focusIndexExpr) { this.focusIndexExpr = focusIndexExpr; } 216 220 public void setMethodExpr(String methodExpr) { this.methodExpr = methodExpr; } 221 225 public void setOnresetExpr(String onresetExpr) { this.onresetExpr = onresetExpr; } 226 230 public void setOnsubmitExpr(String onsubmitExpr) { this.onsubmitExpr = onsubmitExpr; } 231 235 public void setReadonlyExpr(String readonlyExpr) { this.readonlyExpr = readonlyExpr; } 236 240 public void setScriptLanguageExpr(String scriptLanguageExpr) { this.scriptLanguageExpr = scriptLanguageExpr; } 241 245 public void setStyleExpr(String styleExpr) { this.styleExpr = styleExpr; } 246 250 public void setStyleClassExpr(String styleClassExpr) { this.styleClassExpr = styleClassExpr; } 251 255 public void setStyleIdExpr(String styleIdExpr) { this.styleIdExpr = styleIdExpr; } 256 260 public void setTargetExpr(String targetExpr) { this.targetExpr = targetExpr; } 261 265 public void setAcceptCharsetExpr(String acceptCharsetExpr) { this.acceptCharsetExpr = acceptCharsetExpr; } 266 267 270 public void release() 271 { 272 super.release(); 273 setActionExpr(null); 274 setDisabledExpr(null); 275 setEnctypeExpr(null); 276 setFocusExpr(null); 277 setFocusIndexExpr(null); 278 setMethodExpr(null); 279 setOnresetExpr(null); 280 setOnsubmitExpr(null); 281 setReadonlyExpr(null); 282 setScriptLanguageExpr(null); 283 setStyleExpr(null); 284 setStyleClassExpr(null); 285 setStyleIdExpr(null); 286 setTargetExpr(null); 287 setAcceptCharsetExpr(null); 288 } 289 290 295 public int doStartTag() throws JspException { 296 evaluateExpressions(); 297 return(super.doStartTag()); 298 } 299 300 306 private void evaluateExpressions() throws JspException { 307 String string = null; 308 Boolean bool = null; 309 310 if ((string = EvalHelper.evalString("action", getActionExpr(), 311 this, pageContext)) != null) 312 setAction(string); 313 314 if ((bool = EvalHelper.evalBoolean("disabled", getDisabledExpr(), 315 this, pageContext)) != null) 316 setDisabled(bool.booleanValue()); 317 318 if ((string = EvalHelper.evalString("enctype", getEnctypeExpr(), 319 this, pageContext)) != null) 320 setEnctype(string); 321 322 if ((string = EvalHelper.evalString("focus", getFocusExpr(), 323 this, pageContext)) != null) 324 setFocus(string); 325 326 if ((string = EvalHelper.evalString("focusIndex", getFocusIndexExpr(), 327 this, pageContext)) != null) 328 setFocusIndex(string); 329 330 if ((string = EvalHelper.evalString("method", getMethodExpr(), 331 this, pageContext)) != null) 332 setMethod(string); 333 334 if ((string = EvalHelper.evalString("onreset", getOnresetExpr(), 335 this, pageContext)) != null) 336 setOnreset(string); 337 338 if ((string = EvalHelper.evalString("onsubmit", getOnsubmitExpr(), 339 this, pageContext)) != null) 340 setOnsubmit(string); 341 342 if ((bool = EvalHelper.evalBoolean("readonly", getReadonlyExpr(), 343 this, pageContext)) != null) 344 setReadonly(bool.booleanValue()); 345 346 if ((bool = EvalHelper.evalBoolean("scriptLanguage", getScriptLanguageExpr(), 347 this, pageContext)) != null) 348 setScriptLanguage(bool.booleanValue()); 349 350 if ((string = EvalHelper.evalString("style", getStyleExpr(), 351 this, pageContext)) != null) 352 setStyle(string); 353 354 if ((string = EvalHelper.evalString("styleClass", getStyleClassExpr(), 355 this, pageContext)) != null) 356 setStyleClass(string); 357 358 if ((string = EvalHelper.evalString("styleId", getStyleIdExpr(), 359 this, pageContext)) != null) 360 setStyleId(string); 361 362 if ((string = EvalHelper.evalString("target", getTargetExpr(), 363 this, pageContext)) != null) 364 setTarget(string); 365 366 if ((string = EvalHelper.evalString("acceptCharset", getAcceptCharsetExpr(), 367 this, pageContext)) != null) 368 setAcceptCharset(string); 369 370 } 371 } 372 | Popular Tags |