KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dbforms > taglib > DbDateLabelTag


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/taglib/DbDateLabelTag.java,v 1.19 2004/08/24 00:32:35 javajunkie Exp $
3  * $Revision: 1.19 $
4  * $Date: 2004/08/24 00:32:35 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23
24 package org.dbforms.taglib;
25
26 import org.dbforms.util.Util;
27
28 import javax.servlet.jsp.JspException JavaDoc;
29
30
31
32 /**
33  * Philip Grunikiewicz 2001-05-14 This class inherits from DbLabelTag. It
34  * allows a developer to specify the displayed date format.
35  */

36 public class DbDateLabelTag extends DbLabelTag
37    implements javax.servlet.jsp.tagext.TryCatchFinally JavaDoc {
38    /**
39     * @see javax.servlet.jsp.tagext.TryCatchFinally#doCatch(java.lang.Throwable)
40     */

41    public void doCatch(Throwable JavaDoc t) throws Throwable JavaDoc {
42       throw t;
43    }
44
45
46    /**
47     * Philip Grunikiewicz 2001-05-14 If user has specified a date format - use
48     * it!
49     *
50     * @return DOCUMENT ME!
51     */

52    public int doEndTag() throws javax.servlet.jsp.JspException JavaDoc {
53       try {
54          String JavaDoc fieldValue = getFormattedFieldValue();
55
56          // SM 2003-08-05
57
// if styleClass is present, render a SPAN with text included
58
fieldValue = escapeHTML(fieldValue);
59
60          String JavaDoc s = prepareStyles();
61
62          if (Util.isNull(s)) {
63             pageContext.getOut()
64                        .write(fieldValue);
65          } else {
66             pageContext.getOut()
67                        .write("<span " + s + ">" + fieldValue + "</span>");
68          }
69       } catch (Exception JavaDoc e) {
70          throw new JspException JavaDoc("Error: " + e.getMessage());
71       }
72
73       return EVAL_PAGE;
74    }
75
76
77    /**
78     * DOCUMENT ME!
79     */

80    public void doFinally() {
81       super.doFinally();
82    }
83 }
84
Popular Tags