首页 > 移动平台 > 详细

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

时间:2021-02-26 19:22:38      阅读:284      评论:0      收藏:0      [点我收藏+]

缺少添加依赖。

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;

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!