|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.netuix.servlets.l10n.L10nResourceManager
The L10nResourceManager
helps resolve resources
(such as JSP pages, static resources such as HTML files, images
etc.) based on a given locale.
Given a resource path in the form [dir]/[name] where [dir] is the directory ("/" separated, relative to the web app root) and [name] is the name of the resource, this class resolves the path to a localized version, if available.
For resolving a resource to a localized version, this class expects the locale to be present in the path structure as one of the sub-directory.
For instance, the following localized resources are considered valid for a resource "/portlets/news/flash.jsp":
This classes resolves for a localized version in the following search order:
In order to enable this class to recognize newly added or deleted resources after server startup, enable hot deployment for classes via the WebLogic Server admin console.
Constructor Summary | |
protected |
L10nResourceManager(ServletContext context)
Constructs an instance of L10nResourceManager for the given context. |
Method Summary | |
void |
ensureReloaded()
Make sure the cache is fresh. |
static L10nResourceManager |
getInstance(ServletContext context)
Returns an instance of L10nResourceManager . |
Enumeration |
getPreferredLocales(ServletRequest request)
Accessor for getting an Enumeration of preferred locales based on both the request and the setting of the internal localeProvider object, which is optionally overrideable by developers. |
ArrayList |
getPreferredLocalesAsList(ServletRequest request)
Accessor for getting an ordered collection of preferred locales. |
String |
resolve(String path,
Enumeration locales)
Resolves the given path per the given locales to a localized resource. |
String |
resolve(String path,
Enumeration locales,
ResolvedLocale resolvedLocale)
Version of resolve that accepts an out argument that is to be populated with extra resolution information |
String |
resolve(String path,
ServletRequest request)
Resolves the given path per the given locales to a localized resource. |
String |
resolve(String path,
ServletRequest request,
ResolvedLocale resolvedLocale)
Version of resolve that accepts an out argument that is to be populated with extra resolution information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected L10nResourceManager(ServletContext context)
Constructs an instance of L10nResourceManager
for the given context.
context
- servlet contextMethod Detail |
public static L10nResourceManager getInstance(ServletContext context)
Returns an instance of L10nResourceManager
.
context
- servlet context
public void ensureReloaded()
public Enumeration getPreferredLocales(ServletRequest request)
request
- public ArrayList getPreferredLocalesAsList(ServletRequest request)
public String resolve(String path, ServletRequest request)
Resolves the given path per the given locales to a localized resource. Applications may use this method to resolve resources such as JSP pages, or other static resources to locales.
path
- path to the resourcerequest
- current ServletRequest
public String resolve(String path, ServletRequest request, ResolvedLocale resolvedLocale)
path
- request
- resolvedLocale
- public String resolve(String path, Enumeration locales)
Resolves the given path per the given locales to a localized resource. Applications may use this method to resolve resources such as JSP pages, or other static resources to locales.
path
- path to the resourcelocales
- preferred locales to use for resolution
public String resolve(String path, Enumeration locales, ResolvedLocale resolvedLocale)
path
- locales
- resolvedLocale
-
|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |