关于WebMvcConfigurationSupport的大坑-静态资源访问不了

WebMvcConfigurationSupport是spring boot2.0以后用来替代WebMvcConfigurerAdapter,但是如果你直接用WebMvcConfigurationSupport替换掉WebMvcConfigurerAdap就会发现各种各样的错误。

原因其实就是当我们使用WebMvcConfigurationSupport时WebMvc自动化配置就会失效,刚入门的小白,真的是花了我大量的时间,所以写个帖子绕过在这个坑,最简单的解决办法就是将:

extends WebMvcConfigurationSupport 替换为 implements WebMvcConfigure。

 

具体的原因可以看这篇文章:https://my.oschina.net/pwh19920920/blog/2413927

你可能感兴趣的:(spring,boot)