Springboot中"RestController cannot be resolved to a type"

刚开始学习Springboot,然后使用http://start.spring.io/生成了一个实例,但是在使用@RestController注解的时候提示”RestController cannot be resolved to a type”,

原因是pom.xml中添加支持web的模块:

 

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

 

文章来自:https://www.cnblogs.com/htyq-zkh/p/8203702.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3