类 I18nConfiguration

  • 所有已实现的接口:
    org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    public class I18nConfiguration
    extends java.lang.Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    国际化相关配置
    作者:
    jiawei
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)  
      org.springframework.web.servlet.i18n.LocaleChangeInterceptor localeChangeInterceptor()
      使用参数修改用户的区域,默认为:locale,中文参数值为(zh_CN),英文(en_US)
      org.springframework.web.servlet.LocaleResolver localeResolver()
      Set SessionLocaleResolver as default LocaleResolver
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 从接口继承的方法 org.springframework.web.servlet.config.annotation.WebMvcConfigurer

        addArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
    • 构造器详细资料

      • I18nConfiguration

        public I18nConfiguration()
    • 方法详细资料

      • localeResolver

        @Bean
        public org.springframework.web.servlet.LocaleResolver localeResolver()
        Set SessionLocaleResolver as default LocaleResolver
        返回:
        SessionLocaleResolver
      • localeChangeInterceptor

        @Bean
        public org.springframework.web.servlet.i18n.LocaleChangeInterceptor localeChangeInterceptor()
        使用参数修改用户的区域,默认为:locale,中文参数值为(zh_CN),英文(en_US)
        返回:
        LocaleChangeInterceptor
      • addInterceptors

        public void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
        指定者:
        addInterceptors 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer