org.apache.beehive.netui.tags.html
Class FormatDate
Object
SimpleTagSupport
AbstractSimpleTag
FormatTag
FormatDate
- All Implemented Interfaces:
- JspTag, SimpleTag, INetuiTag
public class FormatDate
- extends FormatTag
A formatter used to format dates. This formatter uses patterns that conform to
java.text.SimpleDateFormat
pattern syntax. Valid types for formatting are:
- String
- java.sql.Date
- java.util.Date
- java.util.Calendar
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:
- MM/dd/yy
- yyyy-MM-dd
- MMddyy
- and the local default
- Example
- In this sample, the <netui:label> tag's output will be formatted to something like 08/29/1957.
<netui:label value="{pageContext.today}">
<netui:formatDate pattern="MM/dd/yyyy" />
</netui:label>
Method Summary |
void |
doTag()
Create the internal Formatter instance and perform the formatting. |
String |
getTagName()
Return the name of the Tag. |
void |
setStringInputPattern(String inputPattern)
Set the pattern to use to convert a String value into a date. |
Methods inherited from class AbstractSimpleTag |
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write |
Methods inherited from class SimpleTagSupport |
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FormatDate
public FormatDate()
getTagName
public String getTagName()
- Return the name of the Tag.
- Specified by:
getTagName
in interface INetuiTag
- Specified by:
getTagName
in class AbstractSimpleTag
- Returns:
- the name of the tag.
setStringInputPattern
public void setStringInputPattern(String inputPattern)
throws JspException
- Set the pattern to use to convert a String value into a date. This
will be used before the common formats.
- Parameters:
inputPattern
- the pattern representing the string input
- Throws:
JspException
doTag
public void doTag()
throws JspException
- Create the internal Formatter instance and perform the formatting.
- Specified by:
doTag
in interface SimpleTag
- Overrides:
doTag
in class SimpleTagSupport
- Throws:
JspException
- if a JSP exception has occurred