|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.taglibs.i18n.MessageTag
This class implements a body tag that allows you to use a resource bundle to internationalize content in a web page. The "key" attribute is required, and is used to look up content in the resource bundle. The "args" attribute is optional, and if present, provides items to pass to a MessageFormat. The BundleTag must first be used in order to ensure that the proper bundle is loaded.
<i18n:bundle baseName="test"/> <i18n:getMessage key="test"/> <i18n:getMessage key="test" args="1,2,3"/> etc...
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 | |
MessageTag()
|
Method Summary | |
protected void |
addArg(java.lang.Object arg)
adds to the list of arguments used when formatting the message |
int |
doAfterBody()
If key is not found, use the body content as a default value. |
int |
doEndTag()
Performs the proper runtime substitution. |
int |
doStartTag()
locates the bundle and gets the value |
void |
release()
clears the argument list so that sub tags can call addArgument clears out any previous key and value in case key is not provided, or the value is null |
void |
setArgs(java.lang.Object[] args)
allows setting all the arguments at once |
void |
setBundle(java.util.ResourceBundle aBundle)
sets the bundle to an actual ResourceBundle object if neither bundle or bundleRef are specified, uses the bundle most recently defined on the page by the i18n:bundle tag |
void |
setBundleRef(java.lang.String varName)
sets the bundle based on a variable defined in the page if neither bundle or bundleRef are specified, uses the first bundle defined on the page by the i18n:bundle tag |
void |
setDebug(boolean value)
Turn debugging log messages on or off |
void |
setKey(java.lang.String key)
sets the key to use when looking up the value in the bundle |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, 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 |
public MessageTag()
Method Detail |
public final void setKey(java.lang.String key)
public final void setBundleRef(java.lang.String varName)
public final void setBundle(java.util.ResourceBundle aBundle)
public final void setDebug(boolean value)
protected final void addArg(java.lang.Object arg)
public final void setArgs(java.lang.Object[] args)
public final void release()
public final int doStartTag() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public int doAfterBody() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public final int doEndTag() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |