程序包 cn.taketoday.web
接口 LocaleContextResolver
- 所有超级接口:
LocaleResolver
- 所有已知实现类:
AbstractLocaleContextResolver,CookieLocaleResolver,FixedLocaleResolver,SessionLocaleResolver
Extension of
LocaleResolver, adding support for a rich locale context
(potentially including locale and time zone information).- 从以下版本开始:
- 4.0 2022/2/3 22:54
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
LocaleContextTimeZoneAwareLocaleContextLocaleContextHolderRequestContextUtils.getTimeZone(cn.taketoday.web.RequestContext)
-
字段概要
从接口继承的字段 cn.taketoday.web.LocaleResolver
BEAN_NAME -
方法概要
修饰符和类型方法说明cn.taketoday.core.i18n.LocaleContextresolveLocaleContext(RequestContext request) Resolve the current locale context via the given request.voidsetLocaleContext(RequestContext request, cn.taketoday.core.i18n.LocaleContext localeContext) Set the current locale context to the given one, potentially including a locale with associated time zone information.从接口继承的方法 cn.taketoday.web.LocaleResolver
resolveLocale, setLocale
-
方法详细资料
-
resolveLocaleContext
Resolve the current locale context via the given request.This is primarily intended for framework-level processing; consider using
RequestContextUtilsorRequestContextfor application-level access to the current locale and/or time zone.The returned context may be a
TimeZoneAwareLocaleContext, containing a locale with associated time zone information. Simply apply aninstanceofcheck and downcast accordingly.Custom resolver implementations may also return extra settings in the returned context, which again can be accessed through downcasting.
- 参数:
request- the request to resolve the locale context for- 返回:
- the current locale context (never
null - 另请参阅:
-
setLocaleContext
void setLocaleContext(RequestContext request, @Nullable cn.taketoday.core.i18n.LocaleContext localeContext) Set the current locale context to the given one, potentially including a locale with associated time zone information.- 参数:
request- the request to be used for locale modificationlocaleContext- the new locale context, ornullto clear the locale- 抛出:
UnsupportedOperationException- if the LocaleResolver implementation does not support dynamic changing of the locale or time zone- 另请参阅:
-
LocaleResolver.setLocale(RequestContext, Locale)SimpleLocaleContextSimpleTimeZoneAwareLocaleContext
-