org.apache.tiles.locale.impl
public class: DefaultLocaleResolver [javadoc |
source]
java.lang.Object
org.apache.tiles.locale.impl.DefaultLocaleResolver
All Implemented Interfaces:
LocaleResolver
Default implementation of
LocaleResolver
It tries to take the locale from the session-scoped attribute
DefaultLocaleResolver#LOCALE_KEY . If it is not found, it returns the
locale included in the request.
- version:
$
- Rev: 637434 $ $Date: 2008-03-15 16:48:38 +0100 (sab, 15 mar 2008) $
Field Summary |
---|
public static final String | LOCALE_KEY | The attribute name that is used to store the current locale. |
Method from org.apache.tiles.locale.impl.DefaultLocaleResolver Summary: |
---|
init, resolveLocale |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.tiles.locale.impl.DefaultLocaleResolver Detail: |
public void init(Map<String, String> params) {
// Does nothing.
}
|
public Locale resolveLocale(TilesRequestContext request) {
Locale retValue = null;
Map< String, Object > session = request.getSessionScope();
if (session != null) {
retValue = (Locale) session.get(DefaultLocaleResolver.LOCALE_KEY);
}
if (retValue == null) {
retValue = request.getRequestLocale();
}
return retValue;
}
|