1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.strutsel.taglib.html;
19
20 import org.apache.struts.taglib.html.SubmitTag;
21 import org.apache.strutsel.taglib.utils.EvalHelper;
22
23 import javax.servlet.jsp.JspException;
24
25 /***
26 * Tag for input fields of type "submit". <p> This class is a subclass of the
27 * class <code>org.apache.struts.taglib.html.SubmitTag</code> which provides
28 * most of the described functionality. This subclass allows all attribute
29 * values to be specified as expressions utilizing the JavaServer Pages
30 * Standard Library expression language.
31 *
32 * @version $Rev: 376779 $
33 */
34 public class ELSubmitTag extends SubmitTag {
35 /***
36 * Instance variable mapped to "accessKey" tag attribute. (Mapping set in
37 * associated BeanInfo class.)
38 */
39 private String accessKeyExpr;
40
41 /***
42 * Instance variable mapped to "alt" tag attribute. (Mapping set in
43 * associated BeanInfo class.)
44 */
45 private String altExpr;
46
47 /***
48 * Instance variable mapped to "altKey" tag attribute. (Mapping set in
49 * associated BeanInfo class.)
50 */
51 private String altKeyExpr;
52
53 /***
54 * Instance variable mapped to "bundle" tag attribute. (Mapping set in
55 * associated BeanInfo class.)
56 */
57 private String bundleExpr;
58
59 /***
60 * Instance variable mapped to "disabled" tag attribute. (Mapping set in
61 * associated BeanInfo class.)
62 */
63 private String disabledExpr;
64
65 /***
66 * Instance variable mapped to "indexed" tag attribute. (Mapping set in
67 * associated BeanInfo class.)
68 */
69 private String indexedExpr;
70
71 /***
72 * Instance variable mapped to "onblur" tag attribute. (Mapping set in
73 * associated BeanInfo class.)
74 */
75 private String onblurExpr;
76
77 /***
78 * Instance variable mapped to "onchange" tag attribute. (Mapping set in
79 * associated BeanInfo class.)
80 */
81 private String onchangeExpr;
82
83 /***
84 * Instance variable mapped to "onclick" tag attribute. (Mapping set in
85 * associated BeanInfo class.)
86 */
87 private String onclickExpr;
88
89 /***
90 * Instance variable mapped to "ondblclick" tag attribute. (Mapping set in
91 * associated BeanInfo class.)
92 */
93 private String ondblclickExpr;
94
95 /***
96 * Instance variable mapped to "onfocus" tag attribute. (Mapping set in
97 * associated BeanInfo class.)
98 */
99 private String onfocusExpr;
100
101 /***
102 * Instance variable mapped to "onkeydown" tag attribute. (Mapping set in
103 * associated BeanInfo class.)
104 */
105 private String onkeydownExpr;
106
107 /***
108 * Instance variable mapped to "onkeypress" tag attribute. (Mapping set in
109 * associated BeanInfo class.)
110 */
111 private String onkeypressExpr;
112
113 /***
114 * Instance variable mapped to "onkeyup" tag attribute. (Mapping set in
115 * associated BeanInfo class.)
116 */
117 private String onkeyupExpr;
118
119 /***
120 * Instance variable mapped to "onmousedown" tag attribute. (Mapping set
121 * in associated BeanInfo class.)
122 */
123 private String onmousedownExpr;
124
125 /***
126 * Instance variable mapped to "onmousemove" tag attribute. (Mapping set
127 * in associated BeanInfo class.)
128 */
129 private String onmousemoveExpr;
130
131 /***
132 * Instance variable mapped to "onmouseout" tag attribute. (Mapping set in
133 * associated BeanInfo class.)
134 */
135 private String onmouseoutExpr;
136
137 /***
138 * Instance variable mapped to "onmouseover" tag attribute. (Mapping set
139 * in associated BeanInfo class.)
140 */
141 private String onmouseoverExpr;
142
143 /***
144 * Instance variable mapped to "onmouseup" tag attribute. (Mapping set in
145 * associated BeanInfo class.)
146 */
147 private String onmouseupExpr;
148
149 /***
150 * Instance variable mapped to "property" tag attribute. (Mapping set in
151 * associated BeanInfo class.)
152 */
153 private String propertyExpr;
154
155 /***
156 * Instance variable mapped to "style" tag attribute. (Mapping set in
157 * associated BeanInfo class.)
158 */
159 private String styleExpr;
160
161 /***
162 * Instance variable mapped to "styleClass" tag attribute. (Mapping set in
163 * associated BeanInfo class.)
164 */
165 private String styleClassExpr;
166
167 /***
168 * Instance variable mapped to "styleId" tag attribute. (Mapping set in
169 * associated BeanInfo class.)
170 */
171 private String styleIdExpr;
172
173 /***
174 * Instance variable mapped to "tabindex" tag attribute. (Mapping set in
175 * associated BeanInfo class.)
176 */
177 private String tabindexExpr;
178
179 /***
180 * Instance variable mapped to "title" tag attribute. (Mapping set in
181 * associated BeanInfo class.)
182 */
183 private String titleExpr;
184
185 /***
186 * Instance variable mapped to "titleKey" tag attribute. (Mapping set in
187 * associated BeanInfo class.)
188 */
189 private String titleKeyExpr;
190
191 /***
192 * Instance variable mapped to "value" tag attribute. (Mapping set in
193 * associated BeanInfo class.)
194 */
195 private String valueExpr;
196
197 /***
198 * Getter method for "accessKey" tag attribute. (Mapping set in associated
199 * BeanInfo class.)
200 */
201 public String getAccesskeyExpr() {
202 return (accessKeyExpr);
203 }
204
205 /***
206 * Getter method for "alt" tag attribute. (Mapping set in associated
207 * BeanInfo class.)
208 */
209 public String getAltExpr() {
210 return (altExpr);
211 }
212
213 /***
214 * Getter method for "altKey" tag attribute. (Mapping set in associated
215 * BeanInfo class.)
216 */
217 public String getAltKeyExpr() {
218 return (altKeyExpr);
219 }
220
221 /***
222 * Getter method for "bundle" tag attribute. (Mapping set in associated
223 * BeanInfo class.)
224 */
225 public String getBundleExpr() {
226 return (bundleExpr);
227 }
228
229 /***
230 * Getter method for "disabled" tag attribute. (Mapping set in associated
231 * BeanInfo class.)
232 */
233 public String getDisabledExpr() {
234 return (disabledExpr);
235 }
236
237 /***
238 * Getter method for "indexed" tag attribute. (Mapping set in associated
239 * BeanInfo class.)
240 */
241 public String getIndexedExpr() {
242 return (indexedExpr);
243 }
244
245 /***
246 * Getter method for "onblur" tag attribute. (Mapping set in associated
247 * BeanInfo class.)
248 */
249 public String getOnblurExpr() {
250 return (onblurExpr);
251 }
252
253 /***
254 * Getter method for "onchange" tag attribute. (Mapping set in associated
255 * BeanInfo class.)
256 */
257 public String getOnchangeExpr() {
258 return (onchangeExpr);
259 }
260
261 /***
262 * Getter method for "onclick" tag attribute. (Mapping set in associated
263 * BeanInfo class.)
264 */
265 public String getOnclickExpr() {
266 return (onclickExpr);
267 }
268
269 /***
270 * Getter method for "ondblclick" tag attribute. (Mapping set in
271 * associated BeanInfo class.)
272 */
273 public String getOndblclickExpr() {
274 return (ondblclickExpr);
275 }
276
277 /***
278 * Getter method for "onfocus" tag attribute. (Mapping set in associated
279 * BeanInfo class.)
280 */
281 public String getOnfocusExpr() {
282 return (onfocusExpr);
283 }
284
285 /***
286 * Getter method for "onkeydown" tag attribute. (Mapping set in associated
287 * BeanInfo class.)
288 */
289 public String getOnkeydownExpr() {
290 return (onkeydownExpr);
291 }
292
293 /***
294 * Getter method for "onkeypress" tag attribute. (Mapping set in
295 * associated BeanInfo class.)
296 */
297 public String getOnkeypressExpr() {
298 return (onkeypressExpr);
299 }
300
301 /***
302 * Getter method for "onkeyup" tag attribute. (Mapping set in associated
303 * BeanInfo class.)
304 */
305 public String getOnkeyupExpr() {
306 return (onkeyupExpr);
307 }
308
309 /***
310 * Getter method for "onmousedown" tag attribute. (Mapping set in
311 * associated BeanInfo class.)
312 */
313 public String getOnmousedownExpr() {
314 return (onmousedownExpr);
315 }
316
317 /***
318 * Getter method for "onmousemove" tag attribute. (Mapping set in
319 * associated BeanInfo class.)
320 */
321 public String getOnmousemoveExpr() {
322 return (onmousemoveExpr);
323 }
324
325 /***
326 * Getter method for "onmouseout" tag attribute. (Mapping set in
327 * associated BeanInfo class.)
328 */
329 public String getOnmouseoutExpr() {
330 return (onmouseoutExpr);
331 }
332
333 /***
334 * Getter method for "onmouseover" tag attribute. (Mapping set in
335 * associated BeanInfo class.)
336 */
337 public String getOnmouseoverExpr() {
338 return (onmouseoverExpr);
339 }
340
341 /***
342 * Getter method for "onmouseup" tag attribute. (Mapping set in associated
343 * BeanInfo class.)
344 */
345 public String getOnmouseupExpr() {
346 return (onmouseupExpr);
347 }
348
349 /***
350 * Getter method for "property" tag attribute. (Mapping set in associated
351 * BeanInfo class.)
352 */
353 public String getPropertyExpr() {
354 return (propertyExpr);
355 }
356
357 /***
358 * Getter method for "style" tag attribute. (Mapping set in associated
359 * BeanInfo class.)
360 */
361 public String getStyleExpr() {
362 return (styleExpr);
363 }
364
365 /***
366 * Getter method for "styleClass" tag attribute. (Mapping set in
367 * associated BeanInfo class.)
368 */
369 public String getStyleClassExpr() {
370 return (styleClassExpr);
371 }
372
373 /***
374 * Getter method for "styleId" tag attribute. (Mapping set in associated
375 * BeanInfo class.)
376 */
377 public String getStyleIdExpr() {
378 return (styleIdExpr);
379 }
380
381 /***
382 * Getter method for "tabindex" tag attribute. (Mapping set in associated
383 * BeanInfo class.)
384 */
385 public String getTabindexExpr() {
386 return (tabindexExpr);
387 }
388
389 /***
390 * Getter method for "title" tag attribute. (Mapping set in associated
391 * BeanInfo class.)
392 */
393 public String getTitleExpr() {
394 return (titleExpr);
395 }
396
397 /***
398 * Getter method for "titleKey" tag attribute. (Mapping set in associated
399 * BeanInfo class.)
400 */
401 public String getTitleKeyExpr() {
402 return (titleKeyExpr);
403 }
404
405 /***
406 * Getter method for "value" tag attribute. (Mapping set in associated
407 * BeanInfo class.)
408 */
409 public String getValueExpr() {
410 return (valueExpr);
411 }
412
413 /***
414 * Setter method for "accessKey" tag attribute. (Mapping set in associated
415 * BeanInfo class.)
416 */
417 public void setAccesskeyExpr(String accessKeyExpr) {
418 this.accessKeyExpr = accessKeyExpr;
419 }
420
421 /***
422 * Setter method for "alt" tag attribute. (Mapping set in associated
423 * BeanInfo class.)
424 */
425 public void setAltExpr(String altExpr) {
426 this.altExpr = altExpr;
427 }
428
429 /***
430 * Setter method for "altKey" tag attribute. (Mapping set in associated
431 * BeanInfo class.)
432 */
433 public void setAltKeyExpr(String altKeyExpr) {
434 this.altKeyExpr = altKeyExpr;
435 }
436
437 /***
438 * Setter method for "bundle" tag attribute. (Mapping set in associated
439 * BeanInfo class.)
440 */
441 public void setBundleExpr(String bundleExpr) {
442 this.bundleExpr = bundleExpr;
443 }
444
445 /***
446 * Setter method for "disabled" tag attribute. (Mapping set in associated
447 * BeanInfo class.)
448 */
449 public void setDisabledExpr(String disabledExpr) {
450 this.disabledExpr = disabledExpr;
451 }
452
453 /***
454 * Setter method for "indexed" tag attribute. (Mapping set in associated
455 * BeanInfo class.)
456 */
457 public void setIndexedExpr(String indexedExpr) {
458 this.indexedExpr = indexedExpr;
459 }
460
461 /***
462 * Setter method for "onblur" tag attribute. (Mapping set in associated
463 * BeanInfo class.)
464 */
465 public void setOnblurExpr(String onblurExpr) {
466 this.onblurExpr = onblurExpr;
467 }
468
469 /***
470 * Setter method for "onchange" tag attribute. (Mapping set in associated
471 * BeanInfo class.)
472 */
473 public void setOnchangeExpr(String onchangeExpr) {
474 this.onchangeExpr = onchangeExpr;
475 }
476
477 /***
478 * Setter method for "onclick" tag attribute. (Mapping set in associated
479 * BeanInfo class.)
480 */
481 public void setOnclickExpr(String onclickExpr) {
482 this.onclickExpr = onclickExpr;
483 }
484
485 /***
486 * Setter method for "ondblclick" tag attribute. (Mapping set in
487 * associated BeanInfo class.)
488 */
489 public void setOndblclickExpr(String ondblclickExpr) {
490 this.ondblclickExpr = ondblclickExpr;
491 }
492
493 /***
494 * Setter method for "onfocus" tag attribute. (Mapping set in associated
495 * BeanInfo class.)
496 */
497 public void setOnfocusExpr(String onfocusExpr) {
498 this.onfocusExpr = onfocusExpr;
499 }
500
501 /***
502 * Setter method for "onkeydown" tag attribute. (Mapping set in associated
503 * BeanInfo class.)
504 */
505 public void setOnkeydownExpr(String onkeydownExpr) {
506 this.onkeydownExpr = onkeydownExpr;
507 }
508
509 /***
510 * Setter method for "onkeypress" tag attribute. (Mapping set in
511 * associated BeanInfo class.)
512 */
513 public void setOnkeypressExpr(String onkeypressExpr) {
514 this.onkeypressExpr = onkeypressExpr;
515 }
516
517 /***
518 * Setter method for "onkeyup" tag attribute. (Mapping set in associated
519 * BeanInfo class.)
520 */
521 public void setOnkeyupExpr(String onkeyupExpr) {
522 this.onkeyupExpr = onkeyupExpr;
523 }
524
525 /***
526 * Setter method for "onmousedown" tag attribute. (Mapping set in
527 * associated BeanInfo class.)
528 */
529 public void setOnmousedownExpr(String onmousedownExpr) {
530 this.onmousedownExpr = onmousedownExpr;
531 }
532
533 /***
534 * Setter method for "onmousemove" tag attribute. (Mapping set in
535 * associated BeanInfo class.)
536 */
537 public void setOnmousemoveExpr(String onmousemoveExpr) {
538 this.onmousemoveExpr = onmousemoveExpr;
539 }
540
541 /***
542 * Setter method for "onmouseout" tag attribute. (Mapping set in
543 * associated BeanInfo class.)
544 */
545 public void setOnmouseoutExpr(String onmouseoutExpr) {
546 this.onmouseoutExpr = onmouseoutExpr;
547 }
548
549 /***
550 * Setter method for "onmouseover" tag attribute. (Mapping set in
551 * associated BeanInfo class.)
552 */
553 public void setOnmouseoverExpr(String onmouseoverExpr) {
554 this.onmouseoverExpr = onmouseoverExpr;
555 }
556
557 /***
558 * Setter method for "onmouseup" tag attribute. (Mapping set in associated
559 * BeanInfo class.)
560 */
561 public void setOnmouseupExpr(String onmouseupExpr) {
562 this.onmouseupExpr = onmouseupExpr;
563 }
564
565 /***
566 * Setter method for "property" tag attribute. (Mapping set in associated
567 * BeanInfo class.)
568 */
569 public void setPropertyExpr(String propertyExpr) {
570 this.propertyExpr = propertyExpr;
571 }
572
573 /***
574 * Setter method for "style" tag attribute. (Mapping set in associated
575 * BeanInfo class.)
576 */
577 public void setStyleExpr(String styleExpr) {
578 this.styleExpr = styleExpr;
579 }
580
581 /***
582 * Setter method for "styleClass" tag attribute. (Mapping set in
583 * associated BeanInfo class.)
584 */
585 public void setStyleClassExpr(String styleClassExpr) {
586 this.styleClassExpr = styleClassExpr;
587 }
588
589 /***
590 * Setter method for "styleId" tag attribute. (Mapping set in associated
591 * BeanInfo class.)
592 */
593 public void setStyleIdExpr(String styleIdExpr) {
594 this.styleIdExpr = styleIdExpr;
595 }
596
597 /***
598 * Setter method for "tabindex" tag attribute. (Mapping set in associated
599 * BeanInfo class.)
600 */
601 public void setTabindexExpr(String tabindexExpr) {
602 this.tabindexExpr = tabindexExpr;
603 }
604
605 /***
606 * Setter method for "title" tag attribute. (Mapping set in associated
607 * BeanInfo class.)
608 */
609 public void setTitleExpr(String titleExpr) {
610 this.titleExpr = titleExpr;
611 }
612
613 /***
614 * Setter method for "titleKey" tag attribute. (Mapping set in associated
615 * BeanInfo class.)
616 */
617 public void setTitleKeyExpr(String titleKeyExpr) {
618 this.titleKeyExpr = titleKeyExpr;
619 }
620
621 /***
622 * Setter method for "value" tag attribute. (Mapping set in associated
623 * BeanInfo class.)
624 */
625 public void setValueExpr(String valueExpr) {
626 this.valueExpr = valueExpr;
627 }
628
629 /***
630 * Resets attribute values for tag reuse.
631 */
632 public void release() {
633 super.release();
634 setAccesskeyExpr(null);
635 setAltExpr(null);
636 setAltKeyExpr(null);
637 setBundleExpr(null);
638 setDisabledExpr(null);
639 setIndexedExpr(null);
640 setOnblurExpr(null);
641 setOnchangeExpr(null);
642 setOnclickExpr(null);
643 setOndblclickExpr(null);
644 setOnfocusExpr(null);
645 setOnkeydownExpr(null);
646 setOnkeypressExpr(null);
647 setOnkeyupExpr(null);
648 setOnmousedownExpr(null);
649 setOnmousemoveExpr(null);
650 setOnmouseoutExpr(null);
651 setOnmouseoverExpr(null);
652 setOnmouseupExpr(null);
653 setPropertyExpr(null);
654 setStyleExpr(null);
655 setStyleClassExpr(null);
656 setStyleIdExpr(null);
657 setTabindexExpr(null);
658 setTitleExpr(null);
659 setTitleKeyExpr(null);
660 setValueExpr(null);
661 }
662
663 /***
664 * Process the start tag.
665 *
666 * @throws JspException if a JSP exception has occurred
667 */
668 public int doStartTag() throws JspException {
669 evaluateExpressions();
670
671 return (super.doStartTag());
672 }
673
674 /***
675 * Processes all attribute values which use the JSTL expression evaluation
676 * engine to determine their values.
677 *
678 * @throws JspException if a JSP exception has occurred
679 */
680 private void evaluateExpressions()
681 throws JspException {
682 String string = null;
683 Boolean bool = null;
684
685 if ((string =
686 EvalHelper.evalString("accessKey", getAccesskeyExpr(), this,
687 pageContext)) != null) {
688 setAccesskey(string);
689 }
690
691 if ((string =
692 EvalHelper.evalString("alt", getAltExpr(), this, pageContext)) != null) {
693 setAlt(string);
694 }
695
696 if ((string =
697 EvalHelper.evalString("altKey", getAltKeyExpr(), this,
698 pageContext)) != null) {
699 setAltKey(string);
700 }
701
702 if ((string =
703 EvalHelper.evalString("bundle", getBundleExpr(), this,
704 pageContext)) != null) {
705 setBundle(string);
706 }
707
708 if ((bool =
709 EvalHelper.evalBoolean("disabled", getDisabledExpr(), this,
710 pageContext)) != null) {
711 setDisabled(bool.booleanValue());
712 }
713
714 if ((bool =
715 EvalHelper.evalBoolean("indexed", getIndexedExpr(), this,
716 pageContext)) != null) {
717 setIndexed(bool.booleanValue());
718 }
719
720 if ((string =
721 EvalHelper.evalString("onblur", getOnblurExpr(), this,
722 pageContext)) != null) {
723 setOnblur(string);
724 }
725
726 if ((string =
727 EvalHelper.evalString("onchange", getOnchangeExpr(), this,
728 pageContext)) != null) {
729 setOnchange(string);
730 }
731
732 if ((string =
733 EvalHelper.evalString("onclick", getOnclickExpr(), this,
734 pageContext)) != null) {
735 setOnclick(string);
736 }
737
738 if ((string =
739 EvalHelper.evalString("ondblclick", getOndblclickExpr(), this,
740 pageContext)) != null) {
741 setOndblclick(string);
742 }
743
744 if ((string =
745 EvalHelper.evalString("onfocus", getOnfocusExpr(), this,
746 pageContext)) != null) {
747 setOnfocus(string);
748 }
749
750 if ((string =
751 EvalHelper.evalString("onkeydown", getOnkeydownExpr(), this,
752 pageContext)) != null) {
753 setOnkeydown(string);
754 }
755
756 if ((string =
757 EvalHelper.evalString("onkeypress", getOnkeypressExpr(), this,
758 pageContext)) != null) {
759 setOnkeypress(string);
760 }
761
762 if ((string =
763 EvalHelper.evalString("onkeyup", getOnkeyupExpr(), this,
764 pageContext)) != null) {
765 setOnkeyup(string);
766 }
767
768 if ((string =
769 EvalHelper.evalString("onmousedown", getOnmousedownExpr(),
770 this, pageContext)) != null) {
771 setOnmousedown(string);
772 }
773
774 if ((string =
775 EvalHelper.evalString("onmousemove", getOnmousemoveExpr(),
776 this, pageContext)) != null) {
777 setOnmousemove(string);
778 }
779
780 if ((string =
781 EvalHelper.evalString("onmouseout", getOnmouseoutExpr(), this,
782 pageContext)) != null) {
783 setOnmouseout(string);
784 }
785
786 if ((string =
787 EvalHelper.evalString("onmouseover", getOnmouseoverExpr(),
788 this, pageContext)) != null) {
789 setOnmouseover(string);
790 }
791
792 if ((string =
793 EvalHelper.evalString("onmouseup", getOnmouseupExpr(), this,
794 pageContext)) != null) {
795 setOnmouseup(string);
796 }
797
798 if ((string =
799 EvalHelper.evalString("property", getPropertyExpr(), this,
800 pageContext)) != null) {
801 setProperty(string);
802 }
803
804 if ((string =
805 EvalHelper.evalString("style", getStyleExpr(), this, pageContext)) != null) {
806 setStyle(string);
807 }
808
809 if ((string =
810 EvalHelper.evalString("styleClass", getStyleClassExpr(), this,
811 pageContext)) != null) {
812 setStyleClass(string);
813 }
814
815 if ((string =
816 EvalHelper.evalString("styleId", getStyleIdExpr(), this,
817 pageContext)) != null) {
818 setStyleId(string);
819 }
820
821 if ((string =
822 EvalHelper.evalString("tabindex", getTabindexExpr(), this,
823 pageContext)) != null) {
824 setTabindex(string);
825 }
826
827 if ((string =
828 EvalHelper.evalString("title", getTitleExpr(), this, pageContext)) != null) {
829 setTitle(string);
830 }
831
832 if ((string =
833 EvalHelper.evalString("titleKey", getTitleKeyExpr(), this,
834 pageContext)) != null) {
835 setTitleKey(string);
836 }
837
838 if ((string =
839 EvalHelper.evalString("value", getValueExpr(), this, pageContext)) != null) {
840 setValue(string);
841 }
842 }
843 }