刚开始学习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>
本文介绍了一位初学者在使用Spring Boot时遇到的问题:在使用@RestController注解时出现RestControllercannotberesolvedtoatype的错误。文章详细解释了问题的原因,并提供了解决方案——在pom.xml文件中正确添加spring-boot-starter-web依赖。
1509

被折叠的 条评论
为什么被折叠?



