jp.terasoluna.fw.web.taglib
Class DateTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.taglib.DateFormatterTagBase
jp.terasoluna.fw.web.taglib.DateTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class DateTag
- extends DateFormatterTagBase
Implementation class of date
tag.
Formats the date and time as per the format specified in pattern
attribute.
In DateTag
class, the string of output format which is specified in pattern
attribute,
is parsed as time pattern string of java.text.SimpleDateFormat
class and formatted.
For the details of time pattern string, refer to the documents of java.text.SimpleDateFormat
class.
Attributes supported by tag
Refer to DateFormatterTagBase
.
Scripting variable of custom tag
Refer to DateFormatterTagBase
.
How to use
Convert the value of "field001"
property in "form0001"
bean
into the specified format and output the value.
<t:date name="form0001"
property="field001"
pattern="yyyyy.MMMMM.dd GGG hh:mm aaa" />
=> 1996.July.10 AD 12:08 PM
Set the above bean property to "formatted"
scripting variable without outputting the property.
<t:date id="formatted"
name="form0001"
property="field001"
pattern="yyyyy.MMMMM.dd GGG hh:mm aaa" />
When the date and time data to be formatted is specified in value
attribute of tag without retrieving the data from bean
.
<t:date value="2002/07/25 04:56:23"
pattern="yyyyy.MMMMM.dd GGG hh:mm aaa" />
- See Also:
SimpleDateFormat
,
DateFormatterTagBase
,
Serialized Form
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
pageContext |
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 |
Method Summary |
protected java.lang.String |
doFormat(java.util.Date date)
Formats the date and time data as per the SimpleDateFormat
format specified in pattern attribute.
|
Methods inherited from class jp.terasoluna.fw.web.taglib.DateFormatterTagBase |
doStartTag, getDefaultDateFormat, getFormat, release, setFilter, setFormat, setId, setIgnore, setName, setPattern, setProperty, setScope, setValue |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- Serial version ID
- See Also:
- Constant Field Values
DateTag
public DateTag()
doFormat
protected java.lang.String doFormat(java.util.Date date)
- Formats the date and time data as per the
SimpleDateFormat
format specified in pattern
attribute.
- Specified by:
doFormat
in class DateFormatterTagBase
- Parameters:
date
- Date and time data
- Returns:
- String of output format specified in
pattern
attribute