Class DefaultLocaleResolver

  • All Implemented Interfaces:
    LocaleResolver, RequestLocaleResolver

    public class DefaultLocaleResolver
    extends Object
    implements LocaleResolver, RequestLocaleResolver
    The DefaultLocaleResolver resolves the request's Locale by calling the ServletRequest.getLocales() method, which generally will be the Servlet Container's implementation of this method and thus be based on the client's Accept-Language header.
    • Constructor Detail

      • DefaultLocaleResolver

        public DefaultLocaleResolver()
    • Method Detail

      • resolveLocale

        public List<Locale> resolveLocale​(SlingHttpServletRequest request)
        Return the Locales provided by the ServletRequest.getLocales() method collected in a List.
        Specified by:
        resolveLocale in interface LocaleResolver
        Parameters:
        request - The SlingHttpServletRequest providing hints and information for the Locale resolution.
        Returns:
        The list of Locales to use for internationalization of request processing