解决:Spring开发中遇到Cannot resolve symbol 'web’报错飘红
问题描述
![在这里插入图片描述](https://img-blog.csdnimg.cn/44b8b4fa8ee441f981dff5eecad3149c.png)
原因
从IDEA中初始化中只勾选了Spring Boot DevTools,没有勾Web的选项,会导致这个问题,没有引入Web依赖
![在这里插入图片描述](https://img-blog.csdnimg.cn/9e99435ed9924bd2ba4847b470307f12.png)
解决方法
在pom.xml中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
![在这里插入图片描述](https://img-blog.csdnimg.cn/3c2ee3484a334da895a1785ed0419d25.png)