- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- com.aoindustries.web.struts.aowebtags.TimeTag
-
- All Implemented Interfaces:
Serializable
,BodyTag
,IterationTag
,JspTag
,Tag
public class TimeTag extends BodyTagSupport
- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
-
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_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
Constructors Constructor Description TimeTag()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doEndTag()
int
doStartTag()
static void
writeTimeJavascript(long date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut)
Writes a JavaScript script tag that a time in the user's locale.static void
writeTimeJavascript(Long date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut)
Writes a JavaScript script tag that a time in the user's locale.static void
writeTimeJavascript(Date date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut)
Writes a JavaScript script tag that a time in the user's locale.-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, 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
-
-
-
-
Method Detail
-
writeTimeJavascript
public static void writeTimeJavascript(long date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut) throws IOException
Writes a JavaScript script tag that a time in the user's locale.Because this needs to modify the DOM it can lead to poor performance or large data sets. To provide more performance options, the JavaScript is written to scriptOut. This could then be buffered into one long script to execute at once or using body.onload.
The provided sequence should start at one for any given HTML page because parts of the script will only be written when the sequence is equal to one.
- Throws:
IOException
- See Also:
SQLUtility.formatTime(long)
-
writeTimeJavascript
public static void writeTimeJavascript(Long date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut) throws IOException
Writes a JavaScript script tag that a time in the user's locale. Prints nothing when the date isnull
.Because this needs to modify the DOM it can lead to poor performance or large data sets. To provide more performance options, the JavaScript is written to scriptOut. This could then be buffered into one long script to execute at once or using body.onload.
The provided sequence should start at one for any given HTML page because parts of the script will only be written when the sequence is equal to one.
- Throws:
IOException
- See Also:
SQLUtility.formatTime(java.lang.Long)
-
writeTimeJavascript
public static void writeTimeJavascript(Date date, Sequence sequence, Union_Palpable_Phrasing<?> content, Appendable scriptOut) throws IOException
Writes a JavaScript script tag that a time in the user's locale. Prints nothing when the date isnull
.Because this needs to modify the DOM it can lead to poor performance or large data sets. To provide more performance options, the JavaScript is written to scriptOut. This could then be buffered into one long script to execute at once or using body.onload.
The provided sequence should start at one for any given HTML page because parts of the script will only be written when the sequence is equal to one.
- Throws:
IOException
- See Also:
SQLUtility.formatTime(java.util.Date)
-
doStartTag
public int doStartTag() throws JspException
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classBodyTagSupport
- Throws:
JspException
-
doEndTag
public int doEndTag() throws JspException
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classBodyTagSupport
- Throws:
JspException
-
-