1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.taglib;
25
26 import org.dbforms.util.Util;
27
28 import javax.servlet.jsp.JspException;
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 {
38
39 /***
40 * Philip Grunikiewicz 2001-05-14 If user has specified a date format - use
41 * it!
42 *
43 * @return DOCUMENT ME!
44 */
45 public int doEndTag() throws javax.servlet.jsp.JspException {
46 try {
47 String fieldValue = getFormattedFieldValue();
48
49
50
51 fieldValue = escapeHTML(fieldValue);
52
53 String s = prepareStyles();
54
55 if (Util.isNull(s)) {
56 pageContext.getOut()
57 .write(fieldValue);
58 } else {
59 pageContext.getOut()
60 .write("<span " + s + ">" + fieldValue + "</span>");
61 }
62 } catch (Exception e) {
63 throw new JspException("Error: " + e.getMessage());
64 }
65
66 return EVAL_PAGE;
67 }
68
69
70 /***
71 * DOCUMENT ME!
72 */
73 public void doFinally() {
74 super.doFinally();
75 }
76 }