Package org.deltava.taglib.format
Class DateFormatTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.format.UserSettingsTag
org.deltava.taglib.format.DateFormatTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
A JSP tag to support the display of formatted date/time values.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.taglib.format.UserSettingsTag
_user
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, 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
-
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
Formats the date/time and writes it to the JSP output writer.void
release()
Releases this tag's state variables.void
setClassName
(String cName) Updates the CSS class for this formatted date/time.void
Updates the date format pattern.void
Sets the date/time to display.void
setDefault
(String defaultText) Updates the text to display if the date is null.void
Sets what components of the date/time to display.final void
setPageContext
(PageContext ctxt) Updates this tag's page context and loads the user object from the request.void
setShowZone
(boolean showZone) Overrides whether the time zone should be displayed.void
Updates the time format pattern.void
Overrides the time zone used to display the date/time with.void
Overrides the time zone used to display the date/time with.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
DateFormatTag
public DateFormatTag()
-
-
Method Details
-
setPageContext
Updates this tag's page context and loads the user object from the request.- Specified by:
setPageContext
in interfaceTag
- Overrides:
setPageContext
in classUserSettingsTag
- Parameters:
ctxt
- the new JSP page context
-
setClassName
Updates the CSS class for this formatted date/time. This will automatically enclose the output in a <SPAN> tag.- Parameters:
cName
- the class Name(s)
-
setD
Updates the date format pattern.- Parameters:
pattern
- the pattern string- Throws:
IllegalArgumentException
- ifDateTimeFormatter
cannot interpret the pattern
-
setDefault
Updates the text to display if the date is null.- Parameters:
defaultText
- the text to display
-
setT
Updates the time format pattern.- Parameters:
pattern
- the pattern string- Throws:
IllegalArgumentException
- ifDateTimeFormatter
cannot interpret the pattern
-
setFmt
Sets what components of the date/time to display.- Parameters:
dtFmt
- "dt" to show date/time, "d" for date only, "t" for time only
-
setDate
-
setTz
Overrides the time zone used to display the date/time with.- Parameters:
tz
- the time zone
-
setTzName
Overrides the time zone used to display the date/time with.- Parameters:
tzName
- the time zone name
-
setShowZone
public void setShowZone(boolean showZone) Overrides whether the time zone should be displayed.- Parameters:
showZone
- TRUE if the time zone should be displayed, otherwise FALSE
-
release
public void release()Releases this tag's state variables.- Specified by:
release
in interfaceTag
- Overrides:
release
in classTagSupport
-
doEndTag
Formats the date/time and writes it to the JSP output writer.- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Returns:
- TagSupport.EVAL_PAGE
- Throws:
JspException
- if an error occurs
-