Class CorsAutoConfiguration

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

    @ConditionalOnWebApplication(type=SERVLET)
    @EnableConfigurationProperties(CorsProperties.class)
    @Configuration
    public class CorsAutoConfiguration
    extends Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    The cors auto configuration.
    Author:
    Christian Bremer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCorsMappings​(org.springframework.web.servlet.config.annotation.CorsRegistry corsRegistry)  
      void init()
      Init.
      • Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

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

      • CorsAutoConfiguration

        public CorsAutoConfiguration​(CorsProperties properties)
        Instantiates a new cors auto configuration.
        Parameters:
        properties - the cors properties
    • Method Detail

      • init

        @EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class)
        public void init()
        Init.
      • addCorsMappings

        public void addCorsMappings​(@NonNull
                                    org.springframework.web.servlet.config.annotation.CorsRegistry corsRegistry)
        Specified by:
        addCorsMappings in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer