org.apache.taglibs.datetime
Class TimeZonesTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--org.apache.taglibs.datetime.TimeZonesTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class TimeZonesTag
extends javax.servlet.jsp.tagext.BodyTagSupport

JSP Tag timeZones, used to loop through all the TimeZone's so that ID's and Display Names can be accessed by using the standard JSP <jsp:getProperty> tag.

The script variable of name id is availble only within the body of the timeZones tag.

Loops through all the timeZones.

If the optional attribute locale is true, the Displaynames are formatted 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.

The optional attribute style can be set to SHORT or LONG.

JSP Tag Lib Descriptor

 <name>timeZones</name>
 <tagclass>org.apache.taglibs.datetime.TimeZonesTag</tagclass>
 <teiclass>org.apache.taglibs.datetime.TimeZonesTEI</teiclass>
 <bodycontent>JSP</bodycontent>
 <info>Loop through all the timeZone display names.</info>
   <attribute>
     <name>id</name>
     <required>true</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>
   <attribute>
     <name>style</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
 

Author:
Glenn Nielsen
See Also:
Serialized Form

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
TimeZonesTag()
           
 
Method Summary
 int doAfterBody()
          Method called at end of each timeZones tag.
 int doEndTag()
          Method called at end of Tag
 int doStartTag()
          Initializes tag so it can loop through the time zones.
 java.lang.String getDisplayName()
          Returns the display name of the timeZone.
 java.lang.String getZoneId()
          Returns the value of the time zone ID.
 void setLocale(boolean flag)
          Locale flag, if set to true, format timeZone Displayname 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 setStyle(java.lang.String str)
          Set they style of Displaynames to either SHORT or LONG.
 
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

TimeZonesTag

public TimeZonesTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Initializes tag so it can loop through the time zones.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG, or SKIP_BODY if no time zones are found

doAfterBody

public final int doAfterBody()
                      throws javax.servlet.jsp.JspException
Method called at end of each timeZones tag.
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG if there is another timeZone, or SKIP_BODY if there are no more timeZones

doEndTag

public final int doEndTag()
                   throws javax.servlet.jsp.JspException
Method called at end of Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE

setLocale

public final void setLocale(boolean flag)
Locale flag, if set to true, format timeZone Displayname for client's preferred locale if known.
Parameters:
boolean - either true or false

setLocaleRef

public 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.
Parameters:
String - name of locale attribute to use

setStyle

public final void setStyle(java.lang.String str)
Set they style of Displaynames to either SHORT or LONG.
Parameters:
String - style, either SHORT or LONG

getDisplayName

public final java.lang.String getDisplayName()
                                      throws javax.servlet.jsp.JspException
Returns the display name of the timeZone.

<jsp:getProperty name="id" property="displayName"/>

Returns:
String - display name

getZoneId

public final java.lang.String getZoneId()
Returns the value of the time zone ID.

<jsp:getProperty name="id" property="zoneId"/>

Returns:
String - time zone ID


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.