org.apache.taglibs.datetime
Class AmPmsTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.apache.taglibs.datetime.AmPmsTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

JSP Tag amPms, used to loop through all the am/pm strings so that they 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 amPms tag.

Loops through all the am/pm strings.

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

JSP Tag Lib Descriptor

 <name>amPms</name>
 <tagclass>org.apache.taglibs.datetime.AmPmsTag</tagclass>
 <teiclass>org.apache.taglibs.datetime.AmPmsTEI</teiclass>
 <bodycontent>JSP</bodycontent>
 <info>Loop through all the am/pm 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>
 

Author:
Glenn Nielsen
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
AmPmsTag()
           
 
Method Summary
 int doAfterBody()
          Method called at end of each amPms tag.
 int doEndTag()
          Method called at end of Tag
 int doStartTag()
          Initializes tag so it can loop through the amPms of the year.
 java.lang.String getName()
          Returns the am/pm name.
 void setLocale(boolean flag)
          Locale flag, if set to true, use am/pm names 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.
 
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

AmPmsTag

public AmPmsTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Initializes tag so it can loop through the amPms of the year.

Returns:
EVAL_BODY_TAG
Throws:
javax.servlet.jsp.JspException

doAfterBody

public final int doAfterBody()
                      throws javax.servlet.jsp.JspException
Method called at end of each amPms tag.

Returns:
EVAL_BODY_TAG if there is another name, or SKIP_BODY if there are no more amPms
Throws:
javax.servlet.jsp.JspException

doEndTag

public final int doEndTag()
                   throws javax.servlet.jsp.JspException
Method called at end of Tag

Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException

setLocale

public final void setLocale(boolean flag)
Locale flag, if set to true, use am/pm names for client's preferred locale if known.


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.


getName

public final java.lang.String getName()
Returns the am/pm name.

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

Returns:
String - am/pm name


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.