接口 LocaleResolver

    • 方法详细资料

      • resolveLocale

        Locale resolveLocale​(HttpServletRequest request)
        Resolve the current locale via the given request. Can return a default locale as fallback in any case.
        参数:
        request - the request to resolve the locale for
        返回:
        the current locale (never null)
      • setLocale

        void setLocale​(HttpServletRequest request,
                       HttpServletResponse response,
                       Locale locale)
        Set the current locale to the given one.
        参数:
        request - the request to be used for locale modification
        response - the response to be used for locale modification
        locale - the new locale, or null to clear the locale
        抛出:
        UnsupportedOperationException - if the LocaleResolver implementation does not support dynamic changing of the locale