class JakartaInline
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Locale |
EMPTY_LOCALE |
private static char |
HYPHEN |
(package private) static java.lang.String |
REQUEST_CHAR_SET |
(package private) static java.lang.String |
UNDEFINED_KEY |
private static char |
UNDERSCORE |
Constructor and Description |
---|
JakartaInline() |
Modifier and Type | Method and Description |
---|---|
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() |
(package private) static java.util.Locale |
getLocale(javax.servlet.jsp.PageContext pageContext,
java.lang.String name) |
(package private) static LocalizationContext |
getLocalizationContext(javax.servlet.jsp.PageContext pc)
Gets the default I18N localization context.
|
(package private) 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:
|
static java.util.Enumeration |
getRequestLocales(javax.servlet.http.HttpServletRequest request)
HttpServletRequest.getLocales() returns the server's default locale
if the request did not specify a preferred language.
|
private static java.util.Locale |
parseLocale(java.lang.String locale,
java.lang.String variant)
Parses the given locale string into its language and (optionally)
country components, and returns the corresponding
java.util.Locale object.
|
(package private) static void |
setResponseLocale(javax.servlet.jsp.PageContext pc,
java.util.Locale locale) |
static final java.lang.String UNDEFINED_KEY
private static final java.util.Locale EMPTY_LOCALE
private static final char HYPHEN
private static final char UNDERSCORE
static final java.lang.String REQUEST_CHAR_SET
static LocalizationContext getLocalizationContext(javax.servlet.jsp.PageContext pc)
pc
- Page in which to look up the default I18N localization contextstatic 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.
pageContext
- 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()
public static java.util.Enumeration getRequestLocales(javax.servlet.http.HttpServletRequest request)
static void setResponseLocale(javax.servlet.jsp.PageContext pc, java.util.Locale locale)
static java.util.Locale getLocale(javax.servlet.jsp.PageContext pageContext, java.lang.String name)
private static java.util.Locale parseLocale(java.lang.String locale, java.lang.String variant)
If the given locale string is null or empty, the runtime's default locale is returned.
locale
- the locale string to parsevariant
- the variantjava.lang.IllegalArgumentException
- if the given locale does not have a
language component or has an empty country component