IntelliJ IDEA 新建spring boot 找不到@RestController 、@RequestMapping

时间:2021-02-26 19:22:38   收藏:0   阅读:284

缺少添加依赖。

1.在pom.xml 配置

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
import change 添加以上依赖之后 ,重新添加

2,如果方法1 还没有解决,可以手动导包

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

原文:https://www.cnblogs.com/Jackie-zhang/p/14452836.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!