KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > strutsel > taglib > html > ELSubmitTag


1 /*
2  * $Id: ELSubmitTag.java 123585 2004-12-29 00:43:33Z martinc $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.strutsel.taglib.html;
20
21 import org.apache.struts.taglib.html.SubmitTag;
22 import javax.servlet.jsp.JspException JavaDoc;
23 import org.apache.strutsel.taglib.utils.EvalHelper;
24
25 /**
26  * Tag for input fields of type "submit".
27  *<p>
28  * This class is a subclass of the class
29  * <code>org.apache.struts.taglib.html.SubmitTag</code> which provides most of
30  * the described functionality. This subclass allows all attribute values to
31  * be specified as expressions utilizing the JavaServer Pages Standard Library
32  * expression language.
33  *
34  * @version $Rev: 123585 $
35  */

36 public class ELSubmitTag extends SubmitTag {
37
38     /**
39      * Instance variable mapped to "accessKey" tag attribute.
40      * (Mapping set in associated BeanInfo class.)
41      */

42     private String JavaDoc accessKeyExpr;
43     /**
44      * Instance variable mapped to "alt" tag attribute.
45      * (Mapping set in associated BeanInfo class.)
46      */

47     private String JavaDoc altExpr;
48     /**
49      * Instance variable mapped to "altKey" tag attribute.
50      * (Mapping set in associated BeanInfo class.)
51      */

52     private String JavaDoc altKeyExpr;
53     /**
54      * Instance variable mapped to "bundle" tag attribute.
55      * (Mapping set in associated BeanInfo class.)
56      */

57     private String JavaDoc bundleExpr;
58     /**
59      * Instance variable mapped to "disabled" tag attribute.
60      * (Mapping set in associated BeanInfo class.)
61      */

62     private String JavaDoc disabledExpr;
63     /**
64      * Instance variable mapped to "indexed" tag attribute.
65      * (Mapping set in associated BeanInfo class.)
66      */

67     private String JavaDoc indexedExpr;
68     /**
69      * Instance variable mapped to "onblur" tag attribute.
70      * (Mapping set in associated BeanInfo class.)
71      */

72     private String JavaDoc onblurExpr;
73     /**
74      * Instance variable mapped to "onchange" tag attribute.
75      * (Mapping set in associated BeanInfo class.)
76      */

77     private String JavaDoc onchangeExpr;
78     /**
79      * Instance variable mapped to "onclick" tag attribute.
80      * (Mapping set in associated BeanInfo class.)
81      */

82     private String JavaDoc onclickExpr;
83     /**
84      * Instance variable mapped to "ondblclick" tag attribute.
85      * (Mapping set in associated BeanInfo class.)
86      */

87     private String JavaDoc ondblclickExpr;
88     /**
89      * Instance variable mapped to "onfocus" tag attribute.
90      * (Mapping set in associated BeanInfo class.)
91      */

92     private String JavaDoc onfocusExpr;
93     /**
94      * Instance variable mapped to "onkeydown" tag attribute.
95      * (Mapping set in associated BeanInfo class.)
96      */

97     private String JavaDoc onkeydownExpr;
98     /**
99      * Instance variable mapped to "onkeypress" tag attribute.
100      * (Mapping set in associated BeanInfo class.)
101      */

102     private String JavaDoc onkeypressExpr;
103     /**
104      * Instance variable mapped to "onkeyup" tag attribute.
105      * (Mapping set in associated BeanInfo class.)
106      */

107     private String JavaDoc onkeyupExpr;
108     /**
109      * Instance variable mapped to "onmousedown" tag attribute.
110      * (Mapping set in associated BeanInfo class.)
111      */

112     private String JavaDoc onmousedownExpr;
113     /**
114      * Instance variable mapped to "onmousemove" tag attribute.
115      * (Mapping set in associated BeanInfo class.)
116      */

117     private String JavaDoc onmousemoveExpr;
118     /**
119      * Instance variable mapped to "onmouseout" tag attribute.
120      * (Mapping set in associated BeanInfo class.)
121      */

122     private String JavaDoc onmouseoutExpr;
123     /**
124      * Instance variable mapped to "onmouseover" tag attribute.
125      * (Mapping set in associated BeanInfo class.)
126      */

127     private String JavaDoc onmouseoverExpr;
128     /**
129      * Instance variable mapped to "onmouseup" tag attribute.
130      * (Mapping set in associated BeanInfo class.)
131      */

132     private String JavaDoc onmouseupExpr;
133     /**
134      * Instance variable mapped to "property" tag attribute.
135      * (Mapping set in associated BeanInfo class.)
136      */

137     private String JavaDoc propertyExpr;
138     /**
139      * Instance variable mapped to "style" tag attribute.
140      * (Mapping set in associated BeanInfo class.)
141      */

142     private String JavaDoc styleExpr;
143     /**
144      * Instance variable mapped to "styleClass" tag attribute.
145      * (Mapping set in associated BeanInfo class.)
146      */

147     private String JavaDoc styleClassExpr;
148     /**
149      * Instance variable mapped to "styleId" tag attribute.
150      * (Mapping set in associated BeanInfo class.)
151      */

152     private String JavaDoc styleIdExpr;
153     /**
154      * Instance variable mapped to "tabindex" tag attribute.
155      * (Mapping set in associated BeanInfo class.)
156      */

157     private String JavaDoc tabindexExpr;
158     /**
159      * Instance variable mapped to "title" tag attribute.
160      * (Mapping set in associated BeanInfo class.)
161      */

162     private String JavaDoc titleExpr;
163     /**
164      * Instance variable mapped to "titleKey" tag attribute.
165      * (Mapping set in associated BeanInfo class.)
166      */

167     private String JavaDoc titleKeyExpr;
168     /**
169      * Instance variable mapped to "value" tag attribute.
170      * (Mapping set in associated BeanInfo class.)
171      */

172     private String JavaDoc valueExpr;
173
174     /**
175      * Getter method for "accessKey" tag attribute.
176      * (Mapping set in associated BeanInfo class.)
177      */

178     public String JavaDoc getAccesskeyExpr() { return (accessKeyExpr); }
179     /**
180      * Getter method for "alt" tag attribute.
181      * (Mapping set in associated BeanInfo class.)
182      */

183     public String JavaDoc getAltExpr() { return (altExpr); }
184     /**
185      * Getter method for "altKey" tag attribute.
186      * (Mapping set in associated BeanInfo class.)
187      */

188     public String JavaDoc getAltKeyExpr() { return (altKeyExpr); }
189     /**
190      * Getter method for "bundle" tag attribute.
191      * (Mapping set in associated BeanInfo class.)
192      */

193     public String JavaDoc getBundleExpr() { return (bundleExpr); }
194     /**
195      * Getter method for "disabled" tag attribute.
196      * (Mapping set in associated BeanInfo class.)
197      */

198     public String JavaDoc getDisabledExpr() { return (disabledExpr); }
199     /**
200      * Getter method for "indexed" tag attribute.
201      * (Mapping set in associated BeanInfo class.)
202      */

203     public String JavaDoc getIndexedExpr() { return (indexedExpr); }
204     /**
205      * Getter method for "onblur" tag attribute.
206      * (Mapping set in associated BeanInfo class.)
207      */

208     public String JavaDoc getOnblurExpr() { return (onblurExpr); }
209     /**
210      * Getter method for "onchange" tag attribute.
211      * (Mapping set in associated BeanInfo class.)
212      */

213     public String JavaDoc getOnchangeExpr() { return (onchangeExpr); }
214     /**
215      * Getter method for "onclick" tag attribute.
216      * (Mapping set in associated BeanInfo class.)
217      */

218     public String JavaDoc getOnclickExpr() { return (onclickExpr); }
219     /**
220      * Getter method for "ondblclick" tag attribute.
221      * (Mapping set in associated BeanInfo class.)
222      */

223     public String JavaDoc getOndblclickExpr() { return (ondblclickExpr); }
224     /**
225      * Getter method for "onfocus" tag attribute.
226      * (Mapping set in associated BeanInfo class.)
227      */

228     public String JavaDoc getOnfocusExpr() { return (onfocusExpr); }
229     /**
230      * Getter method for "onkeydown" tag attribute.
231      * (Mapping set in associated BeanInfo class.)
232      */

233     public String JavaDoc getOnkeydownExpr() { return (onkeydownExpr); }
234     /**
235      * Getter method for "onkeypress" tag attribute.
236      * (Mapping set in associated BeanInfo class.)
237      */

238     public String JavaDoc getOnkeypressExpr() { return (onkeypressExpr); }
239     /**
240      * Getter method for "onkeyup" tag attribute.
241      * (Mapping set in associated BeanInfo class.)
242      */

243     public String JavaDoc getOnkeyupExpr() { return (onkeyupExpr); }
244     /**
245      * Getter method for "onmousedown" tag attribute.
246      * (Mapping set in associated BeanInfo class.)
247      */

248     public String JavaDoc getOnmousedownExpr() { return (onmousedownExpr); }
249     /**
250      * Getter method for "onmousemove" tag attribute.
251      * (Mapping set in associated BeanInfo class.)
252      */

253     public String JavaDoc getOnmousemoveExpr() { return (onmousemoveExpr); }
254     /**
255      * Getter method for "onmouseout" tag attribute.
256      * (Mapping set in associated BeanInfo class.)
257      */

258     public String JavaDoc getOnmouseoutExpr() { return (onmouseoutExpr); }
259     /**
260      * Getter method for "onmouseover" tag attribute.
261      * (Mapping set in associated BeanInfo class.)
262      */

263     public String JavaDoc getOnmouseoverExpr() { return (onmouseoverExpr); }
264     /**
265      * Getter method for "onmouseup" tag attribute.
266      * (Mapping set in associated BeanInfo class.)
267      */

268     public String JavaDoc getOnmouseupExpr() { return (onmouseupExpr); }
269     /**
270      * Getter method for "property" tag attribute.
271      * (Mapping set in associated BeanInfo class.)
272      */

273     public String JavaDoc getPropertyExpr() { return (propertyExpr); }
274     /**
275      * Getter method for "style" tag attribute.
276      * (Mapping set in associated BeanInfo class.)
277      */

278     public String JavaDoc getStyleExpr() { return (styleExpr); }
279     /**
280      * Getter method for "styleClass" tag attribute.
281      * (Mapping set in associated BeanInfo class.)
282      */

283     public String JavaDoc getStyleClassExpr() { return (styleClassExpr); }
284     /**
285      * Getter method for "styleId" tag attribute.
286      * (Mapping set in associated BeanInfo class.)
287      */

288     public String JavaDoc getStyleIdExpr() { return (styleIdExpr); }
289     /**
290      * Getter method for "tabindex" tag attribute.
291      * (Mapping set in associated BeanInfo class.)
292      */

293     public String JavaDoc getTabindexExpr() { return (tabindexExpr); }
294     /**
295      * Getter method for "title" tag attribute.
296      * (Mapping set in associated BeanInfo class.)
297      */

298     public String JavaDoc getTitleExpr() { return (titleExpr); }
299     /**
300      * Getter method for "titleKey" tag attribute.
301      * (Mapping set in associated BeanInfo class.)
302      */

303     public String JavaDoc getTitleKeyExpr() { return (titleKeyExpr); }
304     /**
305      * Getter method for "value" tag attribute.
306      * (Mapping set in associated BeanInfo class.)
307      */

308     public String JavaDoc getValueExpr() { return (valueExpr); }
309
310     /**
311      * Setter method for "accessKey" tag attribute.
312      * (Mapping set in associated BeanInfo class.)
313      */

314     public void setAccesskeyExpr(String JavaDoc accessKeyExpr) { this.accessKeyExpr = accessKeyExpr; }
315     /**
316      * Setter method for "alt" tag attribute.
317      * (Mapping set in associated BeanInfo class.)
318      */

319     public void setAltExpr(String JavaDoc altExpr) { this.altExpr = altExpr; }
320     /**
321      * Setter method for "altKey" tag attribute.
322      * (Mapping set in associated BeanInfo class.)
323      */

324     public void setAltKeyExpr(String JavaDoc altKeyExpr) { this.altKeyExpr = altKeyExpr; }
325     /**
326      * Setter method for "bundle" tag attribute.
327      * (Mapping set in associated BeanInfo class.)
328      */

329     public void setBundleExpr(String JavaDoc bundleExpr) { this.bundleExpr = bundleExpr; }
330     /**
331      * Setter method for "disabled" tag attribute.
332      * (Mapping set in associated BeanInfo class.)
333      */

334     public void setDisabledExpr(String JavaDoc disabledExpr) { this.disabledExpr = disabledExpr; }
335     /**
336      * Setter method for "indexed" tag attribute.
337      * (Mapping set in associated BeanInfo class.)
338      */

339     public void setIndexedExpr(String JavaDoc indexedExpr) { this.indexedExpr = indexedExpr; }
340     /**
341      * Setter method for "onblur" tag attribute.
342      * (Mapping set in associated BeanInfo class.)
343      */

344     public void setOnblurExpr(String JavaDoc onblurExpr) { this.onblurExpr = onblurExpr; }
345     /**
346      * Setter method for "onchange" tag attribute.
347      * (Mapping set in associated BeanInfo class.)
348      */

349     public void setOnchangeExpr(String JavaDoc onchangeExpr) { this.onchangeExpr = onchangeExpr; }
350     /**
351      * Setter method for "onclick" tag attribute.
352      * (Mapping set in associated BeanInfo class.)
353      */

354     public void setOnclickExpr(String JavaDoc onclickExpr) { this.onclickExpr = onclickExpr; }
355     /**
356      * Setter method for "ondblclick" tag attribute.
357      * (Mapping set in associated BeanInfo class.)
358      */

359     public void setOndblclickExpr(String JavaDoc ondblclickExpr) { this.ondblclickExpr = ondblclickExpr; }
360     /**
361      * Setter method for "onfocus" tag attribute.
362      * (Mapping set in associated BeanInfo class.)
363      */

364     public void setOnfocusExpr(String JavaDoc onfocusExpr) { this.onfocusExpr = onfocusExpr; }
365     /**
366      * Setter method for "onkeydown" tag attribute.
367      * (Mapping set in associated BeanInfo class.)
368      */

369     public void setOnkeydownExpr(String JavaDoc onkeydownExpr) { this.onkeydownExpr = onkeydownExpr; }
370     /**
371      * Setter method for "onkeypress" tag attribute.
372      * (Mapping set in associated BeanInfo class.)
373      */

374     public void setOnkeypressExpr(String JavaDoc onkeypressExpr) { this.onkeypressExpr = onkeypressExpr; }
375     /**
376      * Setter method for "onkeyup" tag attribute.
377      * (Mapping set in associated BeanInfo class.)
378      */

379     public void setOnkeyupExpr(String JavaDoc onkeyupExpr) { this.onkeyupExpr = onkeyupExpr; }
380     /**
381      * Setter method for "onmousedown" tag attribute.
382      * (Mapping set in associated BeanInfo class.)
383      */

384     public void setOnmousedownExpr(String JavaDoc onmousedownExpr) { this.onmousedownExpr = onmousedownExpr; }
385     /**
386      * Setter method for "onmousemove" tag attribute.
387      * (Mapping set in associated BeanInfo class.)
388      */

389     public void setOnmousemoveExpr(String JavaDoc onmousemoveExpr) { this.onmousemoveExpr = onmousemoveExpr; }
390     /**
391      * Setter method for "onmouseout" tag attribute.
392      * (Mapping set in associated BeanInfo class.)
393      */

394     public void setOnmouseoutExpr(String JavaDoc onmouseoutExpr) { this.onmouseoutExpr = onmouseoutExpr; }
395     /**
396      * Setter method for "onmouseover" tag attribute.
397      * (Mapping set in associated BeanInfo class.)
398      */

399     public void setOnmouseoverExpr(String JavaDoc onmouseoverExpr) { this.onmouseoverExpr = onmouseoverExpr; }
400     /**
401      * Setter method for "onmouseup" tag attribute.
402      * (Mapping set in associated BeanInfo class.)
403      */

404     public void setOnmouseupExpr(String JavaDoc onmouseupExpr) { this.onmouseupExpr = onmouseupExpr; }
405     /**
406      * Setter method for "property" tag attribute.
407      * (Mapping set in associated BeanInfo class.)
408      */

409     public void setPropertyExpr(String JavaDoc propertyExpr) { this.propertyExpr = propertyExpr; }
410     /**
411      * Setter method for "style" tag attribute.
412      * (Mapping set in associated BeanInfo class.)
413      */

414     public void setStyleExpr(String JavaDoc styleExpr) { this.styleExpr = styleExpr; }
415     /**
416      * Setter method for "styleClass" tag attribute.
417      * (Mapping set in associated BeanInfo class.)
418      */

419     public void setStyleClassExpr(String JavaDoc styleClassExpr) { this.styleClassExpr = styleClassExpr; }
420     /**
421      * Setter method for "styleId" tag attribute.
422      * (Mapping set in associated BeanInfo class.)
423      */

424     public void setStyleIdExpr(String JavaDoc styleIdExpr) { this.styleIdExpr = styleIdExpr; }
425     /**
426      * Setter method for "tabindex" tag attribute.
427      * (Mapping set in associated BeanInfo class.)
428      */

429     public void setTabindexExpr(String JavaDoc tabindexExpr) { this.tabindexExpr = tabindexExpr; }
430     /**
431      * Setter method for "title" tag attribute.
432      * (Mapping set in associated BeanInfo class.)
433      */

434     public void setTitleExpr(String JavaDoc titleExpr) { this.titleExpr = titleExpr; }
435     /**
436      * Setter method for "titleKey" tag attribute.
437      * (Mapping set in associated BeanInfo class.)
438      */

439     public void setTitleKeyExpr(String JavaDoc titleKeyExpr) { this.titleKeyExpr = titleKeyExpr; }
440     /**
441      * Setter method for "value" tag attribute.
442      * (Mapping set in associated BeanInfo class.)
443      */

444     public void setValueExpr(String JavaDoc valueExpr) { this.valueExpr = valueExpr; }
445
446     /**
447      * Resets attribute values for tag reuse.
448      */

449     public void release()
450     {
451         super.release();
452         setAccesskeyExpr(null);
453         setAltExpr(null);
454         setAltKeyExpr(null);
455         setBundleExpr(null);
456         setDisabledExpr(null);
457         setIndexedExpr(null);
458         setOnblurExpr(null);
459         setOnchangeExpr(null);
460         setOnclickExpr(null);
461         setOndblclickExpr(null);
462         setOnfocusExpr(null);
463         setOnkeydownExpr(null);
464         setOnkeypressExpr(null);
465         setOnkeyupExpr(null);
466         setOnmousedownExpr(null);
467         setOnmousemoveExpr(null);
468         setOnmouseoutExpr(null);
469         setOnmouseoverExpr(null);
470         setOnmouseupExpr(null);
471         setPropertyExpr(null);
472         setStyleExpr(null);
473         setStyleClassExpr(null);
474         setStyleIdExpr(null);
475         setTabindexExpr(null);
476         setTitleExpr(null);
477         setTitleKeyExpr(null);
478         setValueExpr(null);
479     }
480
481     /**
482      * Process the start tag.
483      *
484      * @exception JspException if a JSP exception has occurred
485      */

486     public int doStartTag() throws JspException JavaDoc {
487         evaluateExpressions();
488         return (super.doStartTag());
489     }
490
491     /**
492      * Processes all attribute values which use the JSTL expression evaluation
493      * engine to determine their values.
494      *
495      * @exception JspException if a JSP exception has occurred
496      */

497     private void evaluateExpressions() throws JspException JavaDoc {
498         String JavaDoc string = null;
499         Boolean JavaDoc bool = null;
500
501         if ((string = EvalHelper.evalString("accessKey", getAccesskeyExpr(),
502                                             this, pageContext)) != null)
503             setAccesskey(string);
504
505         if ((string = EvalHelper.evalString("alt", getAltExpr(),
506                                             this, pageContext)) != null)
507             setAlt(string);
508
509         if ((string = EvalHelper.evalString("altKey", getAltKeyExpr(),
510                                             this, pageContext)) != null)
511             setAltKey(string);
512
513         if ((string = EvalHelper.evalString("bundle", getBundleExpr(),
514                                             this, pageContext)) != null)
515             setBundle(string);
516
517         if ((bool = EvalHelper.evalBoolean("disabled", getDisabledExpr(),
518                                            this, pageContext)) != null)
519             setDisabled(bool.booleanValue());
520
521         if ((bool = EvalHelper.evalBoolean("indexed", getIndexedExpr(),
522                                            this, pageContext)) != null)
523             setIndexed(bool.booleanValue());
524
525         if ((string = EvalHelper.evalString("onblur", getOnblurExpr(),
526                                             this, pageContext)) != null)
527             setOnblur(string);
528
529         if ((string = EvalHelper.evalString("onchange", getOnchangeExpr(),
530                                             this, pageContext)) != null)
531             setOnchange(string);
532
533         if ((string = EvalHelper.evalString("onclick", getOnclickExpr(),
534                                             this, pageContext)) != null)
535             setOnclick(string);
536
537         if ((string = EvalHelper.evalString("ondblclick", getOndblclickExpr(),
538                                             this, pageContext)) != null)
539             setOndblclick(string);
540
541         if ((string = EvalHelper.evalString("onfocus", getOnfocusExpr(),
542                                             this, pageContext)) != null)
543             setOnfocus(string);
544
545         if ((string = EvalHelper.evalString("onkeydown", getOnkeydownExpr(),
546                                             this, pageContext)) != null)
547             setOnkeydown(string);
548
549         if ((string = EvalHelper.evalString("onkeypress", getOnkeypressExpr(),
550                                             this, pageContext)) != null)
551             setOnkeypress(string);
552
553         if ((string = EvalHelper.evalString("onkeyup", getOnkeyupExpr(),
554                                             this, pageContext)) != null)
555             setOnkeyup(string);
556
557         if ((string = EvalHelper.evalString("onmousedown", getOnmousedownExpr(),
558                                             this, pageContext)) != null)
559             setOnmousedown(string);
560
561         if ((string = EvalHelper.evalString("onmousemove", getOnmousemoveExpr(),
562                                             this, pageContext)) != null)
563             setOnmousemove(string);
564
565         if ((string = EvalHelper.evalString("onmouseout", getOnmouseoutExpr(),
566                                             this, pageContext)) != null)
567             setOnmouseout(string);
568
569         if ((string = EvalHelper.evalString("onmouseover", getOnmouseoverExpr(),
570                                             this, pageContext)) != null)
571             setOnmouseover(string);
572
573         if ((string = EvalHelper.evalString("onmouseup", getOnmouseupExpr(),
574                                             this, pageContext)) != null)
575             setOnmouseup(string);
576
577         if ((string = EvalHelper.evalString("property", getPropertyExpr(),
578                                             this, pageContext)) != null)
579             setProperty(string);
580
581         if ((string = EvalHelper.evalString("style", getStyleExpr(),
582                                             this, pageContext)) != null)
583             setStyle(string);
584
585         if ((string = EvalHelper.evalString("styleClass", getStyleClassExpr(),
586                                             this, pageContext)) != null)
587             setStyleClass(string);
588
589         if ((string = EvalHelper.evalString("styleId", getStyleIdExpr(),
590                                             this, pageContext)) != null)
591             setStyleId(string);
592
593         if ((string = EvalHelper.evalString("tabindex", getTabindexExpr(),
594                                             this, pageContext)) != null)
595             setTabindex(string);
596
597         if ((string = EvalHelper.evalString("title", getTitleExpr(),
598                                             this, pageContext)) != null)
599             setTitle(string);
600
601         if ((string = EvalHelper.evalString("titleKey", getTitleKeyExpr(),
602                                             this, pageContext)) != null)
603             setTitleKey(string);
604
605         if ((string = EvalHelper.evalString("value", getValueExpr(),
606                                             this, pageContext)) != null)
607             setValue(string);
608     }
609 }
610
Popular Tags