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.FrameTag;
21 import org.apache.strutsel.taglib.utils.EvalHelper;
22
23 import javax.servlet.jsp.JspException;
24
25 /***
26 * Generate an HTML <code><frame></code> tag with similar capabilities
27 * as those the <code><html:link></code> tag provides for hyperlink
28 * elements. The <code>src</code> element is rendered using the same
29 * technique that {@link org.apache.struts.taglib.html.LinkTag LinkTag} uses
30 * to render the <code>href</code> attribute of a hyperlink. Additionally,
31 * the HTML 4.0 frame tag attributes <code>noresize</code>,
32 * <code>scrolling</code>, <code>marginheight</code>, <code>marginwidth</code>,
33 * <code>frameborder</code>, and <code>longdesc</code> are supported. The
34 * frame <code>name</code> attribute is rendered based on the
35 * <code>frameName</code> property. <p> Note that the value of
36 * <code>longdesc</code> is intended to be a URI, but currently no rewriting
37 * is supported. The attribute is set directly from the property value. <p>
38 * This class is a subclass of the class <code>org.apache.struts.taglib.html.FrameTag</code>
39 * which provides most of the described functionality. This subclass allows
40 * all attribute values to be specified as expressions utilizing the
41 * JavaServer Pages Standard Library expression language.
42 *
43 * @version $Rev: 376779 $
44 */
45 public class ELFrameTag extends FrameTag {
46 /***
47 * Instance variable mapped to "action" tag attribute. (Mapping set in
48 * associated BeanInfo class.)
49 */
50 private String actionExpr;
51
52 /***
53 * Instance variable mapped to "module" tag attribute. (Mapping set in
54 * associated BeanInfo class.)
55 */
56 private String moduleExpr;
57
58 /***
59 * Instance variable mapped to "anchor" tag attribute. (Mapping set in
60 * associated BeanInfo class.)
61 */
62 private String anchorExpr;
63
64 /***
65 * Instance variable mapped to "bundle" tag attribute. (Mapping set in
66 * associated BeanInfo class.)
67 */
68 private String bundleExpr;
69
70 /***
71 * Instance variable mapped to "forward" tag attribute. (Mapping set in
72 * associated BeanInfo class.)
73 */
74 private String forwardExpr;
75
76 /***
77 * Instance variable mapped to "frameborder" tag attribute. (Mapping set
78 * in associated BeanInfo class.)
79 */
80 private String frameborderExpr;
81
82 /***
83 * Instance variable mapped to "frameName" tag attribute. (Mapping set in
84 * associated BeanInfo class.)
85 */
86 private String frameNameExpr;
87
88 /***
89 * Instance variable mapped to "href" tag attribute. (Mapping set in
90 * associated BeanInfo class.)
91 */
92 private String hrefExpr;
93
94 /***
95 * Instance variable mapped to "longdesc" tag attribute. (Mapping set in
96 * associated BeanInfo class.)
97 */
98 private String longdescExpr;
99
100 /***
101 * Instance variable mapped to "marginheight" tag attribute. (Mapping set
102 * in associated BeanInfo class.)
103 */
104 private String marginheightExpr;
105
106 /***
107 * Instance variable mapped to "marginwidth" tag attribute. (Mapping set
108 * in associated BeanInfo class.)
109 */
110 private String marginwidthExpr;
111
112 /***
113 * Instance variable mapped to "name" tag attribute. (Mapping set in
114 * associated BeanInfo class.)
115 */
116 private String nameExpr;
117
118 /***
119 * Instance variable mapped to "noresize" tag attribute. (Mapping set in
120 * associated BeanInfo class.)
121 */
122 private String noresizeExpr;
123
124 /***
125 * Instance variable mapped to "page" tag attribute. (Mapping set in
126 * associated BeanInfo class.)
127 */
128 private String pageExpr;
129
130 /***
131 * Instance variable mapped to "paramId" tag attribute. (Mapping set in
132 * associated BeanInfo class.)
133 */
134 private String paramIdExpr;
135
136 /***
137 * Instance variable mapped to "paramName" tag attribute. (Mapping set in
138 * associated BeanInfo class.)
139 */
140 private String paramNameExpr;
141
142 /***
143 * Instance variable mapped to "paramProperty" tag attribute. (Mapping set
144 * in associated BeanInfo class.)
145 */
146 private String paramPropertyExpr;
147
148 /***
149 * Instance variable mapped to "paramScope" tag attribute. (Mapping set in
150 * associated BeanInfo class.)
151 */
152 private String paramScopeExpr;
153
154 /***
155 * Instance variable mapped to "property" tag attribute. (Mapping set in
156 * associated BeanInfo class.)
157 */
158 private String propertyExpr;
159
160 /***
161 * Instance variable mapped to "scope" tag attribute. (Mapping set in
162 * associated BeanInfo class.)
163 */
164 private String scopeExpr;
165
166 /***
167 * Instance variable mapped to "scrolling" tag attribute. (Mapping set in
168 * associated BeanInfo class.)
169 */
170 private String scrollingExpr;
171
172 /***
173 * Instance variable mapped to "style" tag attribute. (Mapping set in
174 * associated BeanInfo class.)
175 */
176 private String styleExpr;
177
178 /***
179 * Instance variable mapped to "styleClass" tag attribute. (Mapping set in
180 * associated BeanInfo class.)
181 */
182 private String styleClassExpr;
183
184 /***
185 * Instance variable mapped to "styleId" tag attribute. (Mapping set in
186 * associated BeanInfo class.)
187 */
188 private String styleIdExpr;
189
190 /***
191 * Instance variable mapped to "title" tag attribute. (Mapping set in
192 * associated BeanInfo class.)
193 */
194 private String titleExpr;
195
196 /***
197 * Instance variable mapped to "titleKey" tag attribute. (Mapping set in
198 * associated BeanInfo class.)
199 */
200 private String titleKeyExpr;
201
202 /***
203 * Instance variable mapped to "transaction" tag attribute. (Mapping set
204 * in associated BeanInfo class.)
205 */
206 private String transactionExpr;
207
208 /***
209 * Getter method for "action" tag attribute. (Mapping set in associated
210 * BeanInfo class.)
211 */
212 public String getActionExpr() {
213 return (actionExpr);
214 }
215
216 /***
217 * Getter method for "module" tag attribute. (Mapping set in associated
218 * BeanInfo class.)
219 */
220 public String getModuleExpr() {
221 return (moduleExpr);
222 }
223
224 /***
225 * Getter method for "anchor" tag attribute. (Mapping set in associated
226 * BeanInfo class.)
227 */
228 public String getAnchorExpr() {
229 return (anchorExpr);
230 }
231
232 /***
233 * Getter method for "bundle" tag attribute. (Mapping set in associated
234 * BeanInfo class.)
235 */
236 public String getBundleExpr() {
237 return (bundleExpr);
238 }
239
240 /***
241 * Getter method for "forward" tag attribute. (Mapping set in associated
242 * BeanInfo class.)
243 */
244 public String getForwardExpr() {
245 return (forwardExpr);
246 }
247
248 /***
249 * Getter method for "frameborder" tag attribute. (Mapping set in
250 * associated BeanInfo class.)
251 */
252 public String getFrameborderExpr() {
253 return (frameborderExpr);
254 }
255
256 /***
257 * Getter method for "frameName" tag attribute. (Mapping set in associated
258 * BeanInfo class.)
259 */
260 public String getFrameNameExpr() {
261 return (frameNameExpr);
262 }
263
264 /***
265 * Getter method for "href" tag attribute. (Mapping set in associated
266 * BeanInfo class.)
267 */
268 public String getHrefExpr() {
269 return (hrefExpr);
270 }
271
272 /***
273 * Getter method for "longdesc" tag attribute. (Mapping set in associated
274 * BeanInfo class.)
275 */
276 public String getLongdescExpr() {
277 return (longdescExpr);
278 }
279
280 /***
281 * Getter method for "marginheight" tag attribute. (Mapping set in
282 * associated BeanInfo class.)
283 */
284 public String getMarginheightExpr() {
285 return (marginheightExpr);
286 }
287
288 /***
289 * Getter method for "marginwidth" tag attribute. (Mapping set in
290 * associated BeanInfo class.)
291 */
292 public String getMarginwidthExpr() {
293 return (marginwidthExpr);
294 }
295
296 /***
297 * Getter method for "name" tag attribute. (Mapping set in associated
298 * BeanInfo class.)
299 */
300 public String getNameExpr() {
301 return (nameExpr);
302 }
303
304 /***
305 * Getter method for "noresize" tag attribute. (Mapping set in associated
306 * BeanInfo class.)
307 */
308 public String getNoresizeExpr() {
309 return (noresizeExpr);
310 }
311
312 /***
313 * Getter method for "page" tag attribute. (Mapping set in associated
314 * BeanInfo class.)
315 */
316 public String getPageExpr() {
317 return (pageExpr);
318 }
319
320 /***
321 * Getter method for "paramId" tag attribute. (Mapping set in associated
322 * BeanInfo class.)
323 */
324 public String getParamIdExpr() {
325 return (paramIdExpr);
326 }
327
328 /***
329 * Getter method for "paramName" tag attribute. (Mapping set in associated
330 * BeanInfo class.)
331 */
332 public String getParamNameExpr() {
333 return (paramNameExpr);
334 }
335
336 /***
337 * Getter method for "paramProperty" tag attribute. (Mapping set in
338 * associated BeanInfo class.)
339 */
340 public String getParamPropertyExpr() {
341 return (paramPropertyExpr);
342 }
343
344 /***
345 * Getter method for "paramScope" tag attribute. (Mapping set in
346 * associated BeanInfo class.)
347 */
348 public String getParamScopeExpr() {
349 return (paramScopeExpr);
350 }
351
352 /***
353 * Getter method for "property" tag attribute. (Mapping set in associated
354 * BeanInfo class.)
355 */
356 public String getPropertyExpr() {
357 return (propertyExpr);
358 }
359
360 /***
361 * Getter method for "scope" tag attribute. (Mapping set in associated
362 * BeanInfo class.)
363 */
364 public String getScopeExpr() {
365 return (scopeExpr);
366 }
367
368 /***
369 * Getter method for "scrolling" tag attribute. (Mapping set in associated
370 * BeanInfo class.)
371 */
372 public String getScrollingExpr() {
373 return (scrollingExpr);
374 }
375
376 /***
377 * Getter method for "style" tag attribute. (Mapping set in associated
378 * BeanInfo class.)
379 */
380 public String getStyleExpr() {
381 return (styleExpr);
382 }
383
384 /***
385 * Getter method for "styleClass" tag attribute. (Mapping set in
386 * associated BeanInfo class.)
387 */
388 public String getStyleClassExpr() {
389 return (styleClassExpr);
390 }
391
392 /***
393 * Getter method for "styleId" tag attribute. (Mapping set in associated
394 * BeanInfo class.)
395 */
396 public String getStyleIdExpr() {
397 return (styleIdExpr);
398 }
399
400 /***
401 * Getter method for "title" tag attribute. (Mapping set in associated
402 * BeanInfo class.)
403 */
404 public String getTitleExpr() {
405 return (titleExpr);
406 }
407
408 /***
409 * Getter method for "titleKey" tag attribute. (Mapping set in associated
410 * BeanInfo class.)
411 */
412 public String getTitleKeyExpr() {
413 return (titleKeyExpr);
414 }
415
416 /***
417 * Getter method for "transaction" tag attribute. (Mapping set in
418 * associated BeanInfo class.)
419 */
420 public String getTransactionExpr() {
421 return (transactionExpr);
422 }
423
424 /***
425 * Setter method for "action" tag attribute. (Mapping set in associated
426 * BeanInfo class.)
427 */
428 public void setActionExpr(String actionExpr) {
429 this.actionExpr = actionExpr;
430 }
431
432 /***
433 * Setter method for "module" tag attribute. (Mapping set in associated
434 * BeanInfo class.)
435 */
436 public void setModuleExpr(String moduleExpr) {
437 this.moduleExpr = moduleExpr;
438 }
439
440 /***
441 * Setter method for "anchor" tag attribute. (Mapping set in associated
442 * BeanInfo class.)
443 */
444 public void setAnchorExpr(String anchorExpr) {
445 this.anchorExpr = anchorExpr;
446 }
447
448 /***
449 * Setter method for "bundle" tag attribute. (Mapping set in associated
450 * BeanInfo class.)
451 */
452 public void setBundleExpr(String bundleExpr) {
453 this.bundleExpr = bundleExpr;
454 }
455
456 /***
457 * Setter method for "forward" tag attribute. (Mapping set in associated
458 * BeanInfo class.)
459 */
460 public void setForwardExpr(String forwardExpr) {
461 this.forwardExpr = forwardExpr;
462 }
463
464 /***
465 * Setter method for "frameborder" tag attribute. (Mapping set in
466 * associated BeanInfo class.)
467 */
468 public void setFrameborderExpr(String frameborderExpr) {
469 this.frameborderExpr = frameborderExpr;
470 }
471
472 /***
473 * Setter method for "frameName" tag attribute. (Mapping set in associated
474 * BeanInfo class.)
475 */
476 public void setFrameNameExpr(String frameNameExpr) {
477 this.frameNameExpr = frameNameExpr;
478 }
479
480 /***
481 * Setter method for "href" tag attribute. (Mapping set in associated
482 * BeanInfo class.)
483 */
484 public void setHrefExpr(String hrefExpr) {
485 this.hrefExpr = hrefExpr;
486 }
487
488 /***
489 * Setter method for "longdesc" tag attribute. (Mapping set in associated
490 * BeanInfo class.)
491 */
492 public void setLongdescExpr(String longdescExpr) {
493 this.longdescExpr = longdescExpr;
494 }
495
496 /***
497 * Setter method for "marginheight" tag attribute. (Mapping set in
498 * associated BeanInfo class.)
499 */
500 public void setMarginheightExpr(String marginheightExpr) {
501 this.marginheightExpr = marginheightExpr;
502 }
503
504 /***
505 * Setter method for "marginwidth" tag attribute. (Mapping set in
506 * associated BeanInfo class.)
507 */
508 public void setMarginwidthExpr(String marginwidthExpr) {
509 this.marginwidthExpr = marginwidthExpr;
510 }
511
512 /***
513 * Setter method for "name" tag attribute. (Mapping set in associated
514 * BeanInfo class.)
515 */
516 public void setNameExpr(String nameExpr) {
517 this.nameExpr = nameExpr;
518 }
519
520 /***
521 * Setter method for "noresize" tag attribute. (Mapping set in associated
522 * BeanInfo class.)
523 */
524 public void setNoresizeExpr(String noresizeExpr) {
525 this.noresizeExpr = noresizeExpr;
526 }
527
528 /***
529 * Setter method for "page" tag attribute. (Mapping set in associated
530 * BeanInfo class.)
531 */
532 public void setPageExpr(String pageExpr) {
533 this.pageExpr = pageExpr;
534 }
535
536 /***
537 * Setter method for "paramId" tag attribute. (Mapping set in associated
538 * BeanInfo class.)
539 */
540 public void setParamIdExpr(String paramIdExpr) {
541 this.paramIdExpr = paramIdExpr;
542 }
543
544 /***
545 * Setter method for "paramName" tag attribute. (Mapping set in associated
546 * BeanInfo class.)
547 */
548 public void setParamNameExpr(String paramNameExpr) {
549 this.paramNameExpr = paramNameExpr;
550 }
551
552 /***
553 * Setter method for "paramProperty" tag attribute. (Mapping set in
554 * associated BeanInfo class.)
555 */
556 public void setParamPropertyExpr(String paramPropertyExpr) {
557 this.paramPropertyExpr = paramPropertyExpr;
558 }
559
560 /***
561 * Setter method for "paramScope" tag attribute. (Mapping set in
562 * associated BeanInfo class.)
563 */
564 public void setParamScopeExpr(String paramScopeExpr) {
565 this.paramScopeExpr = paramScopeExpr;
566 }
567
568 /***
569 * Setter method for "property" tag attribute. (Mapping set in associated
570 * BeanInfo class.)
571 */
572 public void setPropertyExpr(String propertyExpr) {
573 this.propertyExpr = propertyExpr;
574 }
575
576 /***
577 * Setter method for "scope" tag attribute. (Mapping set in associated
578 * BeanInfo class.)
579 */
580 public void setScopeExpr(String scopeExpr) {
581 this.scopeExpr = scopeExpr;
582 }
583
584 /***
585 * Setter method for "scrolling" tag attribute. (Mapping set in associated
586 * BeanInfo class.)
587 */
588 public void setScrollingExpr(String scrollingExpr) {
589 this.scrollingExpr = scrollingExpr;
590 }
591
592 /***
593 * Setter method for "style" tag attribute. (Mapping set in associated
594 * BeanInfo class.)
595 */
596 public void setStyleExpr(String styleExpr) {
597 this.styleExpr = styleExpr;
598 }
599
600 /***
601 * Setter method for "styleClass" tag attribute. (Mapping set in
602 * associated BeanInfo class.)
603 */
604 public void setStyleClassExpr(String styleClassExpr) {
605 this.styleClassExpr = styleClassExpr;
606 }
607
608 /***
609 * Setter method for "styleId" tag attribute. (Mapping set in associated
610 * BeanInfo class.)
611 */
612 public void setStyleIdExpr(String styleIdExpr) {
613 this.styleIdExpr = styleIdExpr;
614 }
615
616 /***
617 * Setter method for "title" tag attribute. (Mapping set in associated
618 * BeanInfo class.)
619 */
620 public void setTitleExpr(String titleExpr) {
621 this.titleExpr = titleExpr;
622 }
623
624 /***
625 * Setter method for "titleKey" tag attribute. (Mapping set in associated
626 * BeanInfo class.)
627 */
628 public void setTitleKeyExpr(String titleKeyExpr) {
629 this.titleKeyExpr = titleKeyExpr;
630 }
631
632 /***
633 * Setter method for "transaction" tag attribute. (Mapping set in
634 * associated BeanInfo class.)
635 */
636 public void setTransactionExpr(String transactionExpr) {
637 this.transactionExpr = transactionExpr;
638 }
639
640 /***
641 * Resets attribute values for tag reuse.
642 */
643 public void release() {
644 super.release();
645 setActionExpr(null);
646 setModuleExpr(null);
647 setAnchorExpr(null);
648 setBundleExpr(null);
649 setForwardExpr(null);
650 setFrameborderExpr(null);
651 setFrameNameExpr(null);
652 setHrefExpr(null);
653 setLongdescExpr(null);
654 setMarginheightExpr(null);
655 setMarginwidthExpr(null);
656 setNameExpr(null);
657 setNoresizeExpr(null);
658 setPageExpr(null);
659 setParamIdExpr(null);
660 setParamNameExpr(null);
661 setParamPropertyExpr(null);
662 setParamScopeExpr(null);
663 setPropertyExpr(null);
664 setScopeExpr(null);
665 setScrollingExpr(null);
666 setStyleExpr(null);
667 setStyleClassExpr(null);
668 setStyleIdExpr(null);
669 setTitleExpr(null);
670 setTitleKeyExpr(null);
671 setTransactionExpr(null);
672 }
673
674 /***
675 * Process the start tag.
676 *
677 * @throws JspException if a JSP exception has occurred
678 */
679 public int doStartTag() throws JspException {
680 evaluateExpressions();
681
682 return (super.doStartTag());
683 }
684
685 /***
686 * Processes all attribute values which use the JSTL expression evaluation
687 * engine to determine their values.
688 *
689 * @throws JspException if a JSP exception has occurred
690 */
691 private void evaluateExpressions()
692 throws JspException {
693 String string = null;
694 Integer integer = null;
695 Boolean bool = null;
696
697 if ((string =
698 EvalHelper.evalString("action", getActionExpr(), this,
699 pageContext)) != null) {
700 setAction(string);
701 }
702
703 if ((string =
704 EvalHelper.evalString("module", getModuleExpr(), this,
705 pageContext)) != null) {
706 setModule(string);
707 }
708
709 if ((string =
710 EvalHelper.evalString("anchor", getAnchorExpr(), this,
711 pageContext)) != null) {
712 setAnchor(string);
713 }
714
715 if ((string =
716 EvalHelper.evalString("bundle", getBundleExpr(), this,
717 pageContext)) != null) {
718 setBundle(string);
719 }
720
721 if ((string =
722 EvalHelper.evalString("forward", getForwardExpr(), this,
723 pageContext)) != null) {
724 setForward(string);
725 }
726
727 if ((string =
728 EvalHelper.evalString("frameborder", getFrameborderExpr(),
729 this, pageContext)) != null) {
730 setFrameborder(string);
731 }
732
733 if ((string =
734 EvalHelper.evalString("frameName", getFrameNameExpr(), this,
735 pageContext)) != null) {
736 setFrameName(string);
737 }
738
739 if ((string =
740 EvalHelper.evalString("href", getHrefExpr(), this, pageContext)) != null) {
741 setHref(string);
742 }
743
744 if ((string =
745 EvalHelper.evalString("longdesc", getLongdescExpr(), this,
746 pageContext)) != null) {
747 setLongdesc(string);
748 }
749
750 if ((integer =
751 EvalHelper.evalInteger("marginheight", getMarginheightExpr(),
752 this, pageContext)) != null) {
753 setMarginheight(integer);
754 }
755
756 if ((integer =
757 EvalHelper.evalInteger("marginwidth", getMarginwidthExpr(),
758 this, pageContext)) != null) {
759 setMarginwidth(integer);
760 }
761
762 if ((string =
763 EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
764 setName(string);
765 }
766
767 if ((bool =
768 EvalHelper.evalBoolean("noresize", getNoresizeExpr(), this,
769 pageContext)) != null) {
770 setNoresize(bool.booleanValue());
771 }
772
773 if ((string =
774 EvalHelper.evalString("page", getPageExpr(), this, pageContext)) != null) {
775 setPage(string);
776 }
777
778 if ((string =
779 EvalHelper.evalString("paramId", getParamIdExpr(), this,
780 pageContext)) != null) {
781 setParamId(string);
782 }
783
784 if ((string =
785 EvalHelper.evalString("paramName", getParamNameExpr(), this,
786 pageContext)) != null) {
787 setParamName(string);
788 }
789
790 if ((string =
791 EvalHelper.evalString("paramProperty", getParamPropertyExpr(),
792 this, pageContext)) != null) {
793 setParamProperty(string);
794 }
795
796 if ((string =
797 EvalHelper.evalString("paramScope", getParamScopeExpr(), this,
798 pageContext)) != null) {
799 setParamScope(string);
800 }
801
802 if ((string =
803 EvalHelper.evalString("property", getPropertyExpr(), this,
804 pageContext)) != null) {
805 setProperty(string);
806 }
807
808 if ((string =
809 EvalHelper.evalString("scope", getScopeExpr(), this, pageContext)) != null) {
810 setScope(string);
811 }
812
813 if ((string =
814 EvalHelper.evalString("scrolling", getScrollingExpr(), this,
815 pageContext)) != null) {
816 setScrolling(string);
817 }
818
819 if ((string =
820 EvalHelper.evalString("style", getStyleExpr(), this, pageContext)) != null) {
821 setStyle(string);
822 }
823
824 if ((string =
825 EvalHelper.evalString("styleClass", getStyleClassExpr(), this,
826 pageContext)) != null) {
827 setStyleClass(string);
828 }
829
830 if ((string =
831 EvalHelper.evalString("styleId", getStyleIdExpr(), this,
832 pageContext)) != null) {
833 setStyleId(string);
834 }
835
836 if ((string =
837 EvalHelper.evalString("title", getTitleExpr(), this, pageContext)) != null) {
838 setTitle(string);
839 }
840
841 if ((string =
842 EvalHelper.evalString("titleKey", getTitleKeyExpr(), this,
843 pageContext)) != null) {
844 setTitleKey(string);
845 }
846
847 if ((bool =
848 EvalHelper.evalBoolean("transaction", getTransactionExpr(),
849 this, pageContext)) != null) {
850 setTransaction(bool.booleanValue());
851 }
852 }
853 }