|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.jsp.tagext.TagSupport | +--javax.servlet.jsp.tagext.BodyTagSupport | +--org.apache.taglibs.datetime.ParseTag
JSP Tag parse, used to parse a Date string and output the time in ms.
The Date as a string is obtained from the body of the tag.
Uses the optional attribute pattern as the pattern to use when parsing the Date string.
The optional attribute timeZone can be set to the id of a timeZone script varaible so that the Date if adjusted for that timeZone.
If the optional attribute locale is true, the Date is parsed for the clients locale if known.
The optional attribute localeRef can be used to specify the name of a page, session, application, or request scope attribute of type java.util.Locale to use.
If the date string can not be parsed, 0 is returned.
JSP Tag Lib Descriptor
<name>parse</name> <tagclass>org.apache.taglibs.datetime.ParseTag</tagclass> <bodycontent>JSP</bodycontent> <info>Parses a date string and outputs the time in milliseconds since Jan 1, 1970 GMT.</info> <attribute> <name>pattern</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>patternId</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>timeZone</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>locale</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>localeRef</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute>
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 javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
ParseTag()
|
Method Summary | |
int |
doAfterBody()
Method called at end of parse tag body. |
int |
doEndTag()
Method called at end of Tag |
int |
doStartTag()
Method called at start of tag, always returns EVAL_BODY_TAG |
void |
setLocale(boolean flag)
Locale flag, if set to true, date format is for client's preferred locale if known. |
void |
setLocaleRef(java.lang.String value)
Provides a key to search the page context for in order to get the java.util.Locale to use. |
void |
setPattern(java.lang.String str)
Set the pattern to use when parsing Date. |
void |
setPatternId(java.lang.String str)
Set the pattern to use when parsing Date using a script variable attribute. |
void |
setTimeZone(java.lang.String tz)
Set the time zone to use when parsing date. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, 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, setPageContext, setParent |
Constructor Detail |
public ParseTag()
Method Detail |
public final int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
public final int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
public final int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
public final void setLocale(boolean flag)
boolean
- use users locale, true or falsepublic final void setTimeZone(java.lang.String tz)
String
- name of timeZone to usepublic final void setPattern(java.lang.String str)
String
- SimpleDateFormat style time pattern format stringpublic final void setPatternId(java.lang.String str)
String
- name of script variable attribute idpublic void setLocaleRef(java.lang.String value)
String
- name of locale attribute to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |