List of usage examples for org.springframework.web.servlet.config.annotation WebMvcConfigurerAdapter WebMvcConfigurerAdapter
WebMvcConfigurerAdapter
From source file:com.deicos.lince.Initializer.java
@Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override/*from w ww. j av a 2s. com*/ public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/*").allowedOrigins(getServerURL()); } }; }
From source file:ch.ge.ve.protopoc.config.WebSecurityConfigurer.java
@Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override//from w w w .j a va 2 s .c o m public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedMethods("GET", "POST", "OPTIONS").allowedOrigins("*"); } }; }
From source file:de.whs.poodle.Poodle.java
@Bean @Autowired/*ww w.j av a2s .c o m*/ public WebMvcConfigurerAdapter webMvcConfigurerAdapter(MessageSource messageSource) { return new WebMvcConfigurerAdapter() { /* Add LocaleChangeInterceptor which allows us to change the * locale of the LocaleResolver by simply appending a GET parameter * (e.g. lang=de) to the current URL. */ @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor l = new LocaleChangeInterceptor(); l.setParamName("lang"); registry.addInterceptor(l); } /* By default, the messages for Java Bean Validation (@Size, @Max etc.) have * to be defined in a separate MessageSource (ValidationMessages.properties). * We define our own validator here so we can set it to use our default * MessageSource and define all message codes in one single file. */ @Override public Validator getValidator() { LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean(); bean.setValidationMessageSource(messageSource); return bean; } }; }
From source file:org.createnet.raptor.auth.service.Application.java
@Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override//from w w w.j av a2 s . co m public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedOrigins("*").allowedMethods("GET", "POST", "PUT", "DELETE") .maxAge(3600); } }; }