|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.taglib.DateFormatterTagBase
jp.terasoluna.fw.web.taglib.JDateTag
public class JDateTag
Implementation class of jdate tag that converts date and time data into wareki format.
While doing the formatting, the date and time data should not be converted
into wareki era ("showa", "S"etc)
or wareki
year(christian era "2002"
but it should be converted
into heisei "14"year
etc)and Japanese notations of days
("Monday", "Monday"
etc).
Formatting is performed according to the format specified in pattern
attribute.
In JDateTag
class,
same as DateTag
class, the output format string which is specified in pattern
attribute is parsed as the time pattern string of
java.text.SimpleDateFormat
class and formatted.
While parsing the time pattern string, following points differ from the DateTag
class.
Symbol | Significance in SimpleDateFormat |
Significance in JdateTag |
---|---|---|
G | Era Example:AD |
Wareki era Ex: HHHH -> HeiseiHHH -> H |
y | Year(Wastern calendar) Ex:2002 |
Year(Wareki) Ex:14 |
E | Day Ex:Tuesday |
Day(Japanese notation) Ex: EEEE -> WednesdayEEE -> Wed |
The above-mentioned wareki era and wareki year are converted by using the dateToWarekiString(String pattern, java.util.Date date)
method of DateUtil
class.
Regarding the configuration method of wareki era and wareki year and the constraints related to the convertible year, refer to
DateUtil
.
The day can be converted by specifying the locale in "ja"
in SimpleDateFotmat
constructor.
For the details of locale and time pattern string, refer to the documents of
java.text.SimpleDateFormat
class.
Refer to DateFormatterTagBase
.
Refer to DateFormatterTagBase
.
To convert the "field001"
property value of "form0001"
bean
into the specified format and output the value,
see the following example.
<t:jdate name="form0001"
property="field001"
pattern="GGGGyyYear MM dd(EEEE) hhmmss" />
=> Heisei 26th July 2002(Friday) 11hr:04 mins 07 seconds
<t:jdate name="form0001"
property="field001"
pattern="G. yyMMdd(E) hhmmss" />
=> H. 26th July 2002(Friday) 11hrs04mins07seconds
To set the property of above bean to
"formatted"
scripting variable
without outputting it to the
custom tag, see the following example.
<t:jdate id="formatted"
name="form0001"
property="field001"
pattern="GGGGyyMMdd(EEEE) hhmmss" />
To specify the date and time data in the value
attribute of custom tag without fetching the data from the bean, see the following example.
<t:jdate value="2002/07/25 04:56:23"
pattern="GGGGyyMMdd(EEEE) hhmmss" />
SimpleDateFormat
,
DateUtil
,
DateFormatterTagBase
,
Serialized FormField Summary | |
---|---|
private static long |
serialVersionUID
Serial version ID |
Fields inherited from class jp.terasoluna.fw.web.taglib.DateFormatterTagBase |
---|
filter, format, id, ignore, name, pattern, property, scope, value |
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 |
Constructor Summary | |
---|---|
JDateTag()
|
Method Summary | |
---|---|
protected java.lang.String |
doFormat(java.util.Date date)
Convert the date and time data into wareki format by referring to the the 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 |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public JDateTag()
Method Detail |
---|
protected java.lang.String doFormat(java.util.Date date)
pattern
attribute.
doFormat
in class DateFormatterTagBase
date
- Date and time data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |