问题描述:在开发controller类时,提示Cannot resolve symbol 'RequestMapping',
明明已经在pom文件中引入了springboot对web的支持:spring-boot-starter-web
但是@RequestMapping飘红了,
解决方法:把光标放到@RequestMapping后面,alt+回车,选择add spring-boot-start-web to classpath?
其实import这个包就好了呀!
import org.springframework.web.bind.annotation.RequestMapping;
本文介绍了在使用Spring Boot开发过程中,遇到Controller类中RequestMapping注解报错的问题,通过添加spring-boot-starter-web到classpath并导入相关包的方法进行解决,突出了开发者的常见困扰和实用技巧。
2万+

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



