java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.taglibs.datetime.ErasTag
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
- public class ErasTag
- extends javax.servlet.jsp.tagext.BodyTagSupport
JSP Tag eras, used to loop through all the era 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 eras tag.
Loops through all the era 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>eras</name>
<tagclass>org.apache.taglibs.datetime.ErasTag</tagclass>
<teiclass>org.apache.taglibs.datetime.ErasTEI</teiclass>
<bodycontent>JSP</bodycontent>
<info>Loop through all the era 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>
|
Method Summary |
int |
doAfterBody()
Method called at end of each eras tag. |
int |
doEndTag()
Method called at end of Tag |
int |
doStartTag()
Initializes tag so it can loop through the eras of the year. |
java.lang.String |
getName()
Returns the era name. |
void |
setLocale(boolean flag)
Locale flag, if set to true, use era 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PATTERN
private static java.lang.String PATTERN
locale_flag
private boolean locale_flag
localeRef
private java.lang.String localeRef
eras
private java.lang.String[] eras
count
private int count
ErasTag
public ErasTag()
doStartTag
public final int doStartTag()
throws javax.servlet.jsp.JspException
- Initializes tag so it can loop through the eras of the year.
doAfterBody
public final int doAfterBody()
throws javax.servlet.jsp.JspException
- Method called at end of each eras tag.
doEndTag
public final int doEndTag()
throws javax.servlet.jsp.JspException
- Method called at end of Tag
setLocale
public final void setLocale(boolean flag)
- Locale flag, if set to true, use era 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 era name.
<jsp:getProperty name="id" property="name"/>