springboot下实现WebMvcConfigurer找不到该类

今天在springboot框架下需要写一个WebMvc的配置类,打算实现官网给的WebMvcConfigurer,但是idea自动提示并没有出现这个接口,看了下maven依赖导入的是spring5.0.9版本,版本没问题,但是找不到这个接口。

后来发现pom中没有引入web依赖,导致其无法识别这是一个web项目。加上web依赖即可

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

猜你喜欢

转载自blog.csdn.net/KKALL1314/article/details/82839340