剛開始學習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>