Class MVCConfig

  • All Implemented Interfaces:
    org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    @Configuration
    public class MVCConfig
    extends java.lang.Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    Spring MVC configuration
    Author:
    Ruslan Nazirov
    • Constructor Summary

      Constructors 
      Constructor Description
      MVCConfig()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)  
      org.springframework.web.servlet.i18n.LocaleChangeInterceptor localeChangeInterceptor()
      Get locale change interceptor
      org.springframework.web.servlet.LocaleResolver localeResolver()
      Get locale resolver
      org.springframework.context.support.ReloadableResourceBundleMessageSource messageSource()
      Get message source with different translations
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

        addArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
    • Constructor Detail

      • MVCConfig

        public MVCConfig()
    • Method Detail

      • localeResolver

        @Bean
        public org.springframework.web.servlet.LocaleResolver localeResolver()
        Get locale resolver
        Returns:
        SessionLocaleResolver
      • localeChangeInterceptor

        @Bean
        public org.springframework.web.servlet.i18n.LocaleChangeInterceptor localeChangeInterceptor()
        Get locale change interceptor
        Returns:
        LocaleChangeInterceptor
      • addInterceptors

        public void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
        Specified by:
        addInterceptors in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
      • messageSource

        @Bean
        public org.springframework.context.support.ReloadableResourceBundleMessageSource messageSource()
        Get message source with different translations
        Returns:
        ReloadableResourceBundleMessageSource