com.jivesoftware.base.tags
Class I18nTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.jivesoftware.base.tags.I18nTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- ArgTag
public class I18nTag
- extends javax.servlet.jsp.tagext.BodyTagSupport
A JSP tag to retrieve i18n'd (internationalized) Strings based on key names.
Usage:
<%-- Register the taglib --%>
<%@ taglib uri="jivetags" prefix="jive" %>
...
<%-- Get the property --%>
<jive:i18n key="some.i18n.key.name" />
Attributes:
- See Also:
- Serialized Form
Field Summary |
protected java.util.List |
arguments
|
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id |
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 |
Method Summary |
void |
addArgument(java.lang.String value)
Add an i18n parameter for the key to be used to parameterize the i18n string. |
int |
doEndTag()
Handles the actual work of getting and returning a localized string given the
parameters and arguments passed in. |
int |
doStartTag()
Always returns Tag.EVAL_BODY_BUFFERED. |
java.lang.String |
getBasename()
Sets the basename to be used when looking up keys in a resource bundle. |
java.lang.String |
getKey()
Returns key of the i18n string to look up. |
void |
setBasename(java.lang.String basename)
Sets the basename to be used when looking up keys in a resource bundle. |
void |
setKey(java.lang.String key)
Sets the key of the i18n string to look up. |
void |
setPageContext(javax.servlet.jsp.PageContext pageContext)
|
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, 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, setParent |
arguments
protected java.util.List arguments
I18nTag
public I18nTag()
getKey
public java.lang.String getKey()
- Returns key of the i18n string to look up. See class description for complete tag
attribute description.
- Returns:
- the key of the i18n string to look up.
setKey
public void setKey(java.lang.String key)
- Sets the key of the i18n string to look up. See the class description for complete tag
attribute description.
- Parameters:
key
- the key of the i18n string to look up.
getBasename
public java.lang.String getBasename()
- Sets the basename to be used when looking up keys in a resource bundle.
- Returns:
- the basename for the resource bundle.
setBasename
public void setBasename(java.lang.String basename)
- Sets the basename to be used when looking up keys in a resource bundle.
- Parameters:
basename
- the basename of the resource bundle.
addArgument
public void addArgument(java.lang.String value)
- Add an i18n parameter for the key to be used to parameterize the i18n string.
setPageContext
public void setPageContext(javax.servlet.jsp.PageContext pageContext)
- Specified by:
setPageContext
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
setPageContext
in class javax.servlet.jsp.tagext.TagSupport
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Always returns Tag.EVAL_BODY_BUFFERED.
- Specified by:
doStartTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
- Returns:
- Always returns BodyTag.EVAL_BODY_BUFFERED
- Throws:
javax.servlet.jsp.JspException
- See Also:
BodyTag.EVAL_BODY_BUFFERED
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Handles the actual work of getting and returning a localized string given the
parameters and arguments passed in.
- Specified by:
doEndTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
- Returns:
- Always returns Tag.EVAL_PAGE
- Throws:
javax.servlet.jsp.JspException
- See Also:
Tag.EVAL_PAGE
Copyright © 1999-2006 Jive Software.