Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

30 lignes
906 B

  1. package com.ffii.tsms.config;
  2. import org.springframework.context.annotation.Bean;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.web.servlet.config.annotation.CorsRegistry;
  5. import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  6. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  7. import org.springframework.web.servlet.view.InternalResourceViewResolver;
  8. @Configuration
  9. @EnableWebMvc
  10. public class WebConfig implements WebMvcConfigurer {
  11. @Override
  12. public void addCorsMappings(CorsRegistry registry) {
  13. registry.addMapping("/**")
  14. .allowedHeaders("*")
  15. .allowedOrigins("*")
  16. .exposedHeaders("filename")
  17. .allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD");
  18. }
  19. @Bean
  20. public InternalResourceViewResolver defaultViewResolver() {
  21. return new InternalResourceViewResolver();
  22. }
  23. }