用idea开发springboot项目,提示Cannot resolve symbol 'RequestMapping'

问题描述:在开发controller类时,提示Cannot resolve symbol 'RequestMapping',

明明已经在pom文件中引入了springboot对web的支持:spring-boot-starter-web

但是@RequestMapping飘红了,

解决方法:把光标放到@RequestMapping后面,alt+回车,选择add spring-boot-start-web to classpath

原文地址:https://www.cnblogs.com/lkldeblog/p/11260317.html