1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.strutsel.taglib.html;
22
23 import org.apache.struts.taglib.html.FormTag;
24 import org.apache.strutsel.taglib.utils.EvalHelper;
25
26 import javax.servlet.jsp.JspException;
27
28
29
30
31
32
33
34
35
36
37
38 public class ELFormTag extends FormTag {
39
40
41
42
43 private String actionExpr;
44
45
46
47
48
49 private String dirExpr;
50
51
52
53
54
55 private String disabledExpr;
56
57
58
59
60
61 private String enctypeExpr;
62
63
64
65
66
67 private String focusExpr;
68
69
70
71
72
73 private String focusIndexExpr;
74
75
76
77
78
79 private String langExpr;
80
81
82
83
84
85 private String methodExpr;
86
87
88
89
90
91 private String onresetExpr;
92
93
94
95
96
97 private String onsubmitExpr;
98
99
100
101
102
103 private String readonlyExpr;
104
105
106
107
108
109 private String scriptLanguageExpr;
110
111
112
113
114
115 private String styleExpr;
116
117
118
119
120
121 private String styleClassExpr;
122
123
124
125
126
127 private String styleIdExpr;
128
129
130
131
132
133 private String targetExpr;
134
135
136
137
138
139 private String acceptCharsetExpr;
140
141
142
143
144
145 public String getActionExpr() {
146 return (actionExpr);
147 }
148
149
150
151
152
153 public String getDirExpr() {
154 return (dirExpr);
155 }
156
157
158
159
160
161 public String getDisabledExpr() {
162 return (disabledExpr);
163 }
164
165
166
167
168
169 public String getEnctypeExpr() {
170 return (enctypeExpr);
171 }
172
173
174
175
176
177 public String getFocusExpr() {
178 return (focusExpr);
179 }
180
181
182
183
184
185 public String getFocusIndexExpr() {
186 return (focusIndexExpr);
187 }
188
189
190
191
192
193 public String getLangExpr() {
194 return (langExpr);
195 }
196
197
198
199
200
201 public String getMethodExpr() {
202 return (methodExpr);
203 }
204
205
206
207
208
209 public String getOnresetExpr() {
210 return (onresetExpr);
211 }
212
213
214
215
216
217 public String getOnsubmitExpr() {
218 return (onsubmitExpr);
219 }
220
221
222
223
224
225 public String getReadonlyExpr() {
226 return (readonlyExpr);
227 }
228
229
230
231
232
233 public String getScriptLanguageExpr() {
234 return (scriptLanguageExpr);
235 }
236
237
238
239
240
241 public String getStyleExpr() {
242 return (styleExpr);
243 }
244
245
246
247
248
249 public String getStyleClassExpr() {
250 return (styleClassExpr);
251 }
252
253
254
255
256
257 public String getStyleIdExpr() {
258 return (styleIdExpr);
259 }
260
261
262
263
264
265 public String getTargetExpr() {
266 return (targetExpr);
267 }
268
269
270
271
272
273 public String getAcceptCharsetExpr() {
274 return (acceptCharsetExpr);
275 }
276
277
278
279
280
281 public void setActionExpr(String actionExpr) {
282 this.actionExpr = actionExpr;
283 }
284
285
286
287
288
289 public void setDirExpr(String dirExpr) {
290 this.dirExpr = dirExpr;
291 }
292
293
294
295
296
297 public void setDisabledExpr(String disabledExpr) {
298 this.disabledExpr = disabledExpr;
299 }
300
301
302
303
304
305 public void setEnctypeExpr(String enctypeExpr) {
306 this.enctypeExpr = enctypeExpr;
307 }
308
309
310
311
312
313 public void setFocusExpr(String focusExpr) {
314 this.focusExpr = focusExpr;
315 }
316
317
318
319
320
321 public void setFocusIndexExpr(String focusIndexExpr) {
322 this.focusIndexExpr = focusIndexExpr;
323 }
324
325
326
327
328
329 public void setLangExpr(String langExpr) {
330 this.langExpr = langExpr;
331 }
332
333
334
335
336
337 public void setMethodExpr(String methodExpr) {
338 this.methodExpr = methodExpr;
339 }
340
341
342
343
344
345 public void setOnresetExpr(String onresetExpr) {
346 this.onresetExpr = onresetExpr;
347 }
348
349
350
351
352
353 public void setOnsubmitExpr(String onsubmitExpr) {
354 this.onsubmitExpr = onsubmitExpr;
355 }
356
357
358
359
360
361 public void setReadonlyExpr(String readonlyExpr) {
362 this.readonlyExpr = readonlyExpr;
363 }
364
365
366
367
368
369 public void setScriptLanguageExpr(String scriptLanguageExpr) {
370 this.scriptLanguageExpr = scriptLanguageExpr;
371 }
372
373
374
375
376
377 public void setStyleExpr(String styleExpr) {
378 this.styleExpr = styleExpr;
379 }
380
381
382
383
384
385 public void setStyleClassExpr(String styleClassExpr) {
386 this.styleClassExpr = styleClassExpr;
387 }
388
389
390
391
392
393 public void setStyleIdExpr(String styleIdExpr) {
394 this.styleIdExpr = styleIdExpr;
395 }
396
397
398
399
400
401 public void setTargetExpr(String targetExpr) {
402 this.targetExpr = targetExpr;
403 }
404
405
406
407
408
409 public void setAcceptCharsetExpr(String acceptCharsetExpr) {
410 this.acceptCharsetExpr = acceptCharsetExpr;
411 }
412
413
414
415
416 public void release() {
417 super.release();
418 setActionExpr(null);
419 setDirExpr(null);
420 setDisabledExpr(null);
421 setEnctypeExpr(null);
422 setFocusExpr(null);
423 setFocusIndexExpr(null);
424 setLangExpr(null);
425 setMethodExpr(null);
426 setOnresetExpr(null);
427 setOnsubmitExpr(null);
428 setReadonlyExpr(null);
429 setScriptLanguageExpr(null);
430 setStyleExpr(null);
431 setStyleClassExpr(null);
432 setStyleIdExpr(null);
433 setTargetExpr(null);
434 setAcceptCharsetExpr(null);
435 }
436
437
438
439
440
441
442 public int doStartTag() throws JspException {
443 evaluateExpressions();
444
445 return (super.doStartTag());
446 }
447
448
449
450
451
452
453
454 private void evaluateExpressions()
455 throws JspException {
456 String string = null;
457 Boolean bool = null;
458
459 if ((string =
460 EvalHelper.evalString("action", getActionExpr(), this,
461 pageContext)) != null) {
462 setAction(string);
463 }
464
465 if ((string =
466 EvalHelper.evalString("dir", getDirExpr(), this,
467 pageContext)) != null) {
468 setDir(string);
469 }
470
471 if ((bool =
472 EvalHelper.evalBoolean("disabled", getDisabledExpr(), this,
473 pageContext)) != null) {
474 setDisabled(bool.booleanValue());
475 }
476
477 if ((string =
478 EvalHelper.evalString("enctype", getEnctypeExpr(), this,
479 pageContext)) != null) {
480 setEnctype(string);
481 }
482
483 if ((string =
484 EvalHelper.evalString("focus", getFocusExpr(), this, pageContext)) != null) {
485 setFocus(string);
486 }
487
488 if ((string =
489 EvalHelper.evalString("focusIndex", getFocusIndexExpr(), this,
490 pageContext)) != null) {
491 setFocusIndex(string);
492 }
493
494 if ((string =
495 EvalHelper.evalString("lang", getLangExpr(), this,
496 pageContext)) != null) {
497 setLang(string);
498 }
499
500 if ((string =
501 EvalHelper.evalString("method", getMethodExpr(), this,
502 pageContext)) != null) {
503 setMethod(string);
504 }
505
506 if ((string =
507 EvalHelper.evalString("onreset", getOnresetExpr(), this,
508 pageContext)) != null) {
509 setOnreset(string);
510 }
511
512 if ((string =
513 EvalHelper.evalString("onsubmit", getOnsubmitExpr(), this,
514 pageContext)) != null) {
515 setOnsubmit(string);
516 }
517
518 if ((bool =
519 EvalHelper.evalBoolean("readonly", getReadonlyExpr(), this,
520 pageContext)) != null) {
521 setReadonly(bool.booleanValue());
522 }
523
524 if ((bool =
525 EvalHelper.evalBoolean("scriptLanguage",
526 getScriptLanguageExpr(), this, pageContext)) != null) {
527 setScriptLanguage(bool.booleanValue());
528 }
529
530 if ((string =
531 EvalHelper.evalString("style", getStyleExpr(), this, pageContext)) != null) {
532 setStyle(string);
533 }
534
535 if ((string =
536 EvalHelper.evalString("styleClass", getStyleClassExpr(), this,
537 pageContext)) != null) {
538 setStyleClass(string);
539 }
540
541 if ((string =
542 EvalHelper.evalString("styleId", getStyleIdExpr(), this,
543 pageContext)) != null) {
544 setStyleId(string);
545 }
546
547 if ((string =
548 EvalHelper.evalString("target", getTargetExpr(), this,
549 pageContext)) != null) {
550 setTarget(string);
551 }
552
553 if ((string =
554 EvalHelper.evalString("acceptCharset", getAcceptCharsetExpr(),
555 this, pageContext)) != null) {
556 setAcceptCharset(string);
557 }
558 }
559 }