WebConfig.java 775 B

12345678910111213141516171819202122
  1. package hello;
  2. import org.springframework.context.annotation.ComponentScan;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.context.annotation.Import;
  5. import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
  6. import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  7. import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  8. @Configuration
  9. @EnableWebMvc
  10. @ComponentScan
  11. @Import(StompConfig.class)
  12. public class WebConfig extends WebMvcConfigurerAdapter {
  13. // Allow serving HTML files through the default Servlet
  14. @Override
  15. public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
  16. configurer.enable();
  17. }
  18. }