类 AbstractLocaleContextResolver
- java.lang.Object
- org.springframework.web.servlet.i18n.AbstractLocaleResolver
- org.springframework.web.servlet.i18n.AbstractLocaleContextResolver
- 所有已实现的接口:
LocaleContextResolver,LocaleResolver
public abstract class AbstractLocaleContextResolver extends AbstractLocaleResolver implements LocaleContextResolver
Abstract base class forLocaleContextResolverimplementations. Provides support for a default locale and a default time zone.Also provides pre-implemented versions of
resolveLocale(javax.servlet.http.HttpServletRequest)andsetLocale(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.Locale), delegating toLocaleContextResolver.resolveLocaleContext(javax.servlet.http.HttpServletRequest)andLocaleContextResolver.setLocaleContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.context.i18n.LocaleContext).- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
AbstractLocaleResolver.setDefaultLocale(java.util.Locale),setDefaultTimeZone(java.util.TimeZone)
构造器概要
构造器 构造器 说明 AbstractLocaleContextResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TimeZonegetDefaultTimeZone()Return the default TimeZone that this resolver is supposed to fall back to, if any.LocaleresolveLocale(HttpServletRequest request)Resolve the current locale via the given request.voidsetDefaultTimeZone(TimeZone defaultTimeZone)Set a default TimeZone that this resolver will return if no other time zone found.voidsetLocale(HttpServletRequest request, HttpServletResponse response, Locale locale)Set the current locale to the given one.从类继承的方法 org.springframework.web.servlet.i18n.AbstractLocaleResolver
getDefaultLocale, setDefaultLocale
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.servlet.LocaleContextResolver
resolveLocaleContext, setLocaleContext
构造器详细资料
AbstractLocaleContextResolver
public AbstractLocaleContextResolver()
方法详细资料
setDefaultTimeZone
public void setDefaultTimeZone(@Nullable TimeZone defaultTimeZone)
Set a default TimeZone that this resolver will return if no other time zone found.
getDefaultTimeZone
@Nullable public TimeZone getDefaultTimeZone()
Return the default TimeZone that this resolver is supposed to fall back to, if any.
resolveLocale
public Locale resolveLocale(HttpServletRequest request)
从接口复制的说明:LocaleResolverResolve the current locale via the given request. Can return a default locale as fallback in any case.- 指定者:
resolveLocale在接口中LocaleResolver- 参数:
request- the request to resolve the locale for- 返回:
- the current locale (never
null)
setLocale
public void setLocale(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Locale locale)
从接口复制的说明:LocaleResolverSet the current locale to the given one.- 指定者:
setLocale在接口中LocaleResolver- 参数:
request- the request to be used for locale modificationresponse- the response to be used for locale modificationlocale- the new locale, ornullto clear the locale