KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > tags > YearsOptionsTag


1 /*
2  * $$Id$$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  * The contents of this file are subject to the Mozilla Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License
8  * at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org.
18  * Portions created by the Initial Developer are Copyright (C) 2004
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  * Dmitry Belov <bel@jresearch.org>
23  *
24  * ***** END LICENSE BLOCK ***** */

25 /*
26  * Created on 04.06.2003
27  *
28  */

29 package org.jresearch.gossip.tags;
30
31 import java.util.Calendar JavaDoc;
32 import java.util.Date JavaDoc;
33
34 import javax.servlet.jsp.JspException JavaDoc;
35
36 /**
37  * DOCUMENT ME!
38  *
39  * @author Bel
40  */

41 public class YearsOptionsTag extends NumericOptionsTag {
42     /**
43      * DOCUMENT ME!
44      *
45      * @return DOCUMENT ME!
46      *
47      * @throws JspException
48      * DOCUMENT ME!
49      */

50     public int doStartTag() throws JspException JavaDoc {
51         try {
52             Calendar JavaDoc cal = Calendar.getInstance();
53             cal.setTime(new Date JavaDoc());
54             setEndValue(cal.get(Calendar.YEAR) - 100);
55             setStartValue(cal.get(Calendar.YEAR));
56         } catch (Exception JavaDoc ex) {
57             throw new JspException JavaDoc("error in YearsOptionsTag tag:", ex);
58         }
59
60         return (super.doStartTag());
61     }
62 }
63
Popular Tags