Class FixedLocaleContextResolver

java.lang.Object
org.springframework.web.server.i18n.FixedLocaleContextResolver
All Implemented Interfaces:
LocaleContextResolver

public class FixedLocaleContextResolver extends Object implements LocaleContextResolver
LocaleContextResolver implementation that always returns a fixed locale and optionally time zone. Default is the current JVM's default locale.

Note: Does not support setLocaleContext(org.springframework.web.server.ServerWebExchange, org.springframework.context.i18n.LocaleContext), as the fixed locale and time zone cannot be changed.

Since:
5.0
Author:
Sebastien Deleuze
  • Constructor Details

    • FixedLocaleContextResolver

      public FixedLocaleContextResolver()
      Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).
    • FixedLocaleContextResolver

      public FixedLocaleContextResolver(Locale locale)
      Create a FixedLocaleResolver that exposes the given locale.
      Parameters:
      locale - the locale to expose
    • FixedLocaleContextResolver

      public FixedLocaleContextResolver(Locale locale, @Nullable TimeZone timeZone)
      Create a FixedLocaleResolver that exposes the given locale and time zone.
      Parameters:
      locale - the locale to expose
      timeZone - the time zone to expose
  • Method Details