|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.bea.wlw.netui.tags.AbstractBaseTag
com.bea.wlw.netui.tags.html.FormatTag
com.bea.wlw.netui.tags.html.FormatDate
public class FormatDate
A formatter used to format dates. This formatter uses patterns that conform to
java.text.SimpleDateFormat pattern syntax. Valid types for formatting are:
If the type is a String, we attempt to create a date out of the String. The String must be defined by a common format list below. If the string is equal the the empty string, it will be returned as the empty string. See java.text.SimpleDateFormat for more information.
The valid formats are:
| Attribute Descriptions | |||
|---|---|---|---|
| Attribute | Required | Runtime Expression Evaluation | Data Bindable |
| country | No | No | No |
| The country code used to determine the locale. | |||
| language | No | No | No |
| The language code used to determine the locale. | |||
| pattern | No | No | Read Only |
| The SimpleDateFormat pattern used to format this date. | |||
| stringInputPattern | No | No | Read Only |
| The pattern used to convert a String value into a date. | |||
FormatNumber,
FormatString,
java.text.NumberFormat,
Serialized Form <netui:label value="{pageContext.today}">
<netui:formatDate pattern="MM/dd/yyyy" />
</netui:label>
java.text.SimpleDateFormat pattern syntax.
Valid types for formatting are:
- String
- java.sql.Date
- java.util.Date
- java.util.Calendar
The <netui:formatDate> tag formats the output of its parent tag. For example:
<netui:content value="{pageContext.euroDate}">
<netui:formatDate pattern="dd-MM-yyyy" />
</netui:content>
The following table summarizes the pattern letters that can be used.
| Letter | Date or Time Component | Examples |
|---|---|---|
G
| Era designator | AD
|
y
| Year | 1996; 96
|
M
| Month in year | July; Jul; 07
|
w
| Week in year | 27
|
W
| Week in month | 2
|
D
| Day in year | 189
|
d
| Day in month | 10
|
F
| Day of week in month | 2
|
E
| Day in week | Tuesday; Tue
|
a
| Am/pm marker | PM
|
H
| Hour in day (0-23) | 0
|
k
| Hour in day (1-24) | 24
|
K
| Hour in am/pm (0-11) | 0
|
h
| Hour in am/pm (1-12) | 12
|
m
| Minute in hour | 30
|
s
| Second in minute | 55
|
S
| Millisecond | 978
|
z
| Time zone | Pacific Standard Time; PST; GMT-08:00
|
Z
| Time zone | -0800
|
java.text.SimpleDateFormat.
If the input type is a String, <netui:formatDate> attempts to convert the String into a java.util.Date object before formatting. For the conversion to succeed, the String must conform to a format listed below.
The valid formats are:
- MM/dd/yy
- yyyy-MM-dd
- MMddyy
- the local default
| Nested Class Summary | |
|---|---|
static class |
FormatDate.DateFormatter
Internal FormatTag.Formatter which uses SimpleDateFormat. |
| Nested classes/interfaces inherited from class com.bea.wlw.netui.tags.html.FormatTag |
|---|
FormatTag.Formatter |
| Field Summary |
|---|
| Fields inherited from class com.bea.wlw.netui.tags.html.FormatTag |
|---|
pattern, patternValue |
| Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
|---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
id, pageContext |
| Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
|---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
|---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
|---|
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
FormatDate()
|
|
| Method Summary | |
|---|---|
int |
doStartTag()
Create the internal Formatter instance and perform the formatting. |
String |
getStringInputPattern()
|
String |
getTagName()
Return the name of the Tag. |
protected void |
localRelease()
Release any acquired resources. |
void |
setStringInputPattern(String pattern)
Set the pattern to use to convert a String value into a date. |
| Methods inherited from class com.bea.wlw.netui.tags.html.FormatTag |
|---|
getCountry, getLanguage, getLocale, getPattern, setCountry, setLanguage, setPattern |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
getParent, setParent |
| Constructor Detail |
|---|
public FormatDate()
| Method Detail |
|---|
public String getTagName()
getTagName in class AbstractBaseTagpublic void setStringInputPattern(String pattern)
pattern - the pattern representing the string inputpublic String getStringInputPattern()
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class FormatTagjavax.servlet.jsp.JspException - if a JSP exception has occurredprotected void localRelease()
localRelease in class FormatTag
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||