接口的使用
org.springframework.context.i18n.LocaleContext
使用LocaleContext的程序包 程序包 说明 org.springframework.context.i18n Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.org.springframework.web.server Core interfaces and classes for Spring's generic, reactive web support.org.springframework.web.server.adapter Implementations to adapt to the underlyingorg.springframework.http.client.reactive
reactive HTTP adapter andHttpHandler
.org.springframework.web.server.i18n Locale related support classes.org.springframework.web.servlet Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.org.springframework.web.servlet.i18n Locale support classes for Spring's web MVC framework.org.springframework.context.i18n中LocaleContext的使用
org.springframework.context.i18n中LocaleContext的子接口 修饰符和类型 接口 说明 interface
TimeZoneAwareLocaleContext
Extension ofLocaleContext
, adding awareness of the current time zone.实现LocaleContext的org.springframework.context.i18n中的类 修饰符和类型 类 说明 class
SimpleLocaleContext
Simple implementation of theLocaleContext
interface, always returning a specifiedLocale
.class
SimpleTimeZoneAwareLocaleContext
Simple implementation of theTimeZoneAwareLocaleContext
interface, always returning a specifiedLocale
andTimeZone
.返回LocaleContext的org.springframework.context.i18n中的方法 修饰符和类型 方法 说明 static LocaleContext
LocaleContextHolder. getLocaleContext()
Return the LocaleContext associated with the current thread, if any.参数类型为LocaleContext的org.springframework.context.i18n中的方法 修饰符和类型 方法 说明 static Locale
LocaleContextHolder. getLocale(LocaleContext localeContext)
Return the Locale associated with the given user context, if any, or the system default Locale otherwise.static TimeZone
LocaleContextHolder. getTimeZone(LocaleContext localeContext)
Return the TimeZone associated with the given user context, if any, or the system default TimeZone otherwise.static void
LocaleContextHolder. setLocaleContext(LocaleContext localeContext)
Associate the given LocaleContext with the current thread, not exposing it as inheritable for child threads.static void
LocaleContextHolder. setLocaleContext(LocaleContext localeContext, boolean inheritable)
Associate the given LocaleContext with the current thread.org.springframework.web.server中LocaleContext的使用
返回LocaleContext的org.springframework.web.server中的方法 修饰符和类型 方法 说明 LocaleContext
ServerWebExchange. getLocaleContext()
Return theLocaleContext
using the configuredLocaleContextResolver
.LocaleContext
ServerWebExchangeDecorator. getLocaleContext()
org.springframework.web.server.adapter中LocaleContext的使用
返回LocaleContext的org.springframework.web.server.adapter中的方法 修饰符和类型 方法 说明 LocaleContext
DefaultServerWebExchange. getLocaleContext()
org.springframework.web.server.i18n中LocaleContext的使用
返回LocaleContext的org.springframework.web.server.i18n中的方法 修饰符和类型 方法 说明 LocaleContext
AcceptHeaderLocaleContextResolver. resolveLocaleContext(ServerWebExchange exchange)
LocaleContext
FixedLocaleContextResolver. resolveLocaleContext(ServerWebExchange exchange)
LocaleContext
LocaleContextResolver. resolveLocaleContext(ServerWebExchange exchange)
Resolve the current locale context via the given exchange.参数类型为LocaleContext的org.springframework.web.server.i18n中的方法 修饰符和类型 方法 说明 void
AcceptHeaderLocaleContextResolver. setLocaleContext(ServerWebExchange exchange, LocaleContext locale)
void
FixedLocaleContextResolver. setLocaleContext(ServerWebExchange exchange, LocaleContext localeContext)
void
LocaleContextResolver. setLocaleContext(ServerWebExchange exchange, LocaleContext localeContext)
Set the current locale context to the given one, potentially including a locale with associated time zone information.org.springframework.web.servlet中LocaleContext的使用
返回LocaleContext的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 protected LocaleContext
DispatcherServlet. buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.protected LocaleContext
FrameworkServlet. buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.LocaleContext
LocaleContextResolver. resolveLocaleContext(HttpServletRequest request)
Resolve the current locale context via the given request.参数类型为LocaleContext的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 void
LocaleContextResolver. setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext)
Set the current locale context to the given one, potentially including a locale with associated time zone information.org.springframework.web.servlet.i18n中LocaleContext的使用
返回LocaleContext的org.springframework.web.servlet.i18n中的方法 修饰符和类型 方法 说明 LocaleContext
CookieLocaleResolver. resolveLocaleContext(HttpServletRequest request)
LocaleContext
FixedLocaleResolver. resolveLocaleContext(HttpServletRequest request)
LocaleContext
SessionLocaleResolver. resolveLocaleContext(HttpServletRequest request)
参数类型为LocaleContext的org.springframework.web.servlet.i18n中的方法 修饰符和类型 方法 说明 void
CookieLocaleResolver. setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext)
void
FixedLocaleResolver. setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext)
void
SessionLocaleResolver. setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext)