WebMvcAutoConfiguration で設定されるべき項目が設定されねーぞ!! ってときは @EnableWebMvc ついてないか確認しよう
WebMvcAutoConfiguration が /webjars/**
に対するパス設定などをしてくれているはずなのに、なぜか有効にならない。。という場合、@EnableWebMvc
がついてないか確認しよう。
If you want to keep Spring Boot MVC features, and you just want to add additional MVC configuration (interceptors, formatters, view controllers etc.) you can add your own @Configuration class of type WebMvcConfigurerAdapter, but without @EnableWebMvc. If you wish to provide custom instances of RequestMappingHandlerMapping, RequestMappingHandlerAdapter or ExceptionHandlerExceptionResolver you can declare a WebMvcRegistrationsAdapter instance providing such components.
without @EnableWebMvc
...!!!
@EnableWebMvc
ついた WebMvcConfigurerAdapter があるとデフォルトの設定が諸々オフになって不便になる。/webjars/**
もマッピングされなくなる。ウケる。
Published: 2016-09-22(Thu) 11:46