类 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 forLocaleContextResolver
implementations. 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()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TimeZone
getDefaultTimeZone()
Return the default TimeZone that this resolver is supposed to fall back to, if any.Locale
resolveLocale(HttpServletRequest request)
Resolve the current locale via the given request.void
setDefaultTimeZone(TimeZone defaultTimeZone)
Set a default TimeZone that this resolver will return if no other time zone found.void
setLocale(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(TimeZone defaultTimeZone)
Set a default TimeZone that this resolver will return if no other time zone found.
getDefaultTimeZone
public TimeZone getDefaultTimeZone()
Return the default TimeZone that this resolver is supposed to fall back to, if any.
resolveLocale
public Locale resolveLocale(HttpServletRequest request)
从接口复制的说明:LocaleResolver
Resolve 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, HttpServletResponse response, Locale locale)
从接口复制的说明:LocaleResolver
Set 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, ornull
to clear the locale