Package com.portal.web.comp
Class MapLanguageToBundle
java.lang.Object
com.portal.web.comp.MapLanguageToBundle
Loads the appropriate resource bundle based
on the Accept-Language and Accept-Charset headers in the HTTP input.
The JSPs request the required character encoding by using the
Content Type attribute in the page directive. The resource bundle
loaded here should use the same encoding.
- Version:
- %version: 5 % %date_modified: Thu Nov 08 18:27:31 2001 %
- Author:
- wgeiger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMapLanguageToBundle
(String bundleName, String languages, String charsets) Constructs a newMapLanguageToBundle
object for the given bundle name, language list, and charset list. -
Method Summary
Modifier and TypeMethodDescriptionGets the resource bundle for the locale.Gets the character set.getCharset
(Locale locale) Gets the character set based on the WebKit locale.static String
getCharset
(Locale locale, String charsets) Gets the resource bundle for the locale.
-
Field Details
-
DEFAULT_CHARSET
- See Also:
-
DEFAULT_CLIENT_CHARSET
- See Also:
-
DEFAULT_JAVA_CHARSET
- See Also:
-
-
Constructor Details
-
MapLanguageToBundle
Constructs a newMapLanguageToBundle
object for the given bundle name, language list, and charset list.- Parameters:
bundleName
- the resource bundle namelanguages
- the Accept-Language headercharsets
- the Accept-Charset header
-
-
Method Details
-
getLocale
Gets the resource bundle for the locale.- Returns:
- The selected locale.
-
getCharset
Gets the character set.- Returns:
- The selected character set.
-
getCharset
Gets the character set based on the WebKit locale.- Returns:
- The requested character set, or if it's null,
a
String
with the locale name.
-
getBundle
Gets the resource bundle for the locale.- Returns:
- The selected resource bundle.
-
getCharset
-