public class SetContentBundleTag extends TagSupport
SetContentBundleTag
implements a custom tag, which sets a
LocalizationContext
backed with a ContentResourceBundle
. This
allows one to use property names as keys in a JSTL formatting action and use
the value of the property as localized message.
The provided resource bundle also uses the resource bundle provided by CQ as a fallback if the underlying Resource does not contain a certain key.
The language/locale of the CQ resource bundle is determined depending on the "source" attribute, which can be either
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
SetContentBundleTag() |
Modifier and Type | Method and Description |
---|---|
int |
doEndTag()
Sets a default
LocalizationContext in Config with a page
scope. |
String |
getBasename() |
String |
getLanguage() |
String |
getSource() |
void |
setBasename(String basename) |
void |
setLanguage(String language) |
void |
setSource(String source) |
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
public int doEndTag()
LocalizationContext
in Config
with a page
scope.doEndTag
in interface Tag
doEndTag
in class TagSupport
Tag.EVAL_PAGE
.Tag.doEndTag()
public void setSource(String source) throws JspException
JspException
public String getSource()
public String getLanguage()
null
if the language should be derived from the path of the current resource.public void setLanguage(String language)
language
- the language that will be used when a resource bundle is
obtained.public String getBasename()
null
.public void setBasename(String basename)
basename
- the basename that will be used when a resource bundle is
obtained.Copyright © 2010 - 2020 Adobe. All Rights Reserved