类 LocaleChangeInterceptor

    • 方法详细资料

      • setParamName

        public void setParamName​(String paramName)
        Set the name of the parameter that contains a locale specification in a locale change request. Default is "locale".
      • getParamName

        public String getParamName()
        Return the name of the parameter that contains a locale specification in a locale change request.
      • setHttpMethods

        public void setHttpMethods​(String... httpMethods)
        Configure the HTTP method(s) over which the locale can be changed.
        参数:
        httpMethods - the methods
        从以下版本开始:
        4.2
      • getHttpMethods

        public String[] getHttpMethods()
        Return the configured HTTP methods.
        从以下版本开始:
        4.2
      • setIgnoreInvalidLocale

        public void setIgnoreInvalidLocale​(boolean ignoreInvalidLocale)
        Set whether to ignore an invalid value for the locale parameter.
        从以下版本开始:
        4.2.2
      • isIgnoreInvalidLocale

        public boolean isIgnoreInvalidLocale()
        Return whether to ignore an invalid value for the locale parameter.
        从以下版本开始:
        4.2.2
      • setLanguageTagCompliant

        public void setLanguageTagCompliant​(boolean languageTagCompliant)
        Specify whether to parse request parameter values as BCP 47 language tags instead of Java's legacy locale specification format. The default is false.

        Note: This mode requires JDK 7 or higher. Set this flag to true for BCP 47 compliance on JDK 7+ only.

        从以下版本开始:
        4.3
        另请参阅:
        Locale.forLanguageTag(String), Locale.toLanguageTag()
      • isLanguageTagCompliant

        public boolean isLanguageTagCompliant()
        Return whether to use BCP 47 language tags instead of Java's legacy locale specification format.
        从以下版本开始:
        4.3