改为如下:
1.(官方推荐)实现WebMvcConfigurer
@Configuration public class WebMvcConfg implements WebMvcConfigurer { }
2.继承WebMvcConfigurationSupport
@Configuration public class WebMvcConfg extends WebMvcConfigurationSupport { }