public abstract class BundleSupport
extends javax.servlet.jsp.tagext.BodyTagSupport
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
basename |
private static java.util.Locale |
EMPTY_LOCALE |
private java.util.Locale |
fallbackLocale |
private LocalizationContext |
locCtxt |
protected java.lang.String |
prefix |
Constructor and Description |
---|
BundleSupport() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag() |
private static LocalizationContext |
findMatch(javax.servlet.jsp.PageContext pageContext,
java.lang.String basename) |
private static java.util.ResourceBundle |
findMatch(java.lang.String basename,
java.util.Locale pref) |
private static java.lang.ClassLoader |
getClassLoaderCheckingPrivilege() |
LocalizationContext |
getLocalizationContext() |
static LocalizationContext |
getLocalizationContext(javax.servlet.jsp.PageContext pc)
Gets the default I18N localization context.
|
static LocalizationContext |
getLocalizationContext(javax.servlet.jsp.PageContext pc,
java.lang.String basename)
Gets the resource bundle with the given base name, whose locale is
determined as follows:
|
java.lang.String |
getPrefix() |
private void |
init() |
void |
release() |
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
private static final java.util.Locale EMPTY_LOCALE
protected java.lang.String basename
protected java.lang.String prefix
private java.util.Locale fallbackLocale
private LocalizationContext locCtxt
private void init()
public LocalizationContext getLocalizationContext()
public java.lang.String getPrefix()
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public static LocalizationContext getLocalizationContext(javax.servlet.jsp.PageContext pc)
pc
- Page in which to look up the default I18N localization contextpublic static LocalizationContext getLocalizationContext(javax.servlet.jsp.PageContext pc, java.lang.String basename)
Check if a match exists between the ordered set of preferred locales and the available locales, for the given base name. The set of preferred locales consists of a single locale (if the javax.servlet.jsp.jstl.fmt.locale configuration setting is present) or is equal to the client's preferred locales determined from the client's browser settings.
If no match was found in the previous step, check if a match exists between the fallback locale (given by the javax.servlet.jsp.jstl.fmt.fallbackLocale configuration setting) and the available locales, for the given base name.
pc
- Page in which the resource bundle with the
given base name is requestedbasename
- Resource bundle base nameprivate static LocalizationContext findMatch(javax.servlet.jsp.PageContext pageContext, java.lang.String basename)
private static java.util.ResourceBundle findMatch(java.lang.String basename, java.util.Locale pref)
private static java.lang.ClassLoader getClassLoaderCheckingPrivilege()