本文主要介绍了spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决,具体如下:

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

如图所示,spring的注解报红,无法引入包,推测是spring-web和spring-webmvc这两个包的问题,去看pom.xml,

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

显示没有问题

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

进入maven库,两个包都存在

那么,问题在哪里呢?

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

扫了一眼project里面的External libraries,发现并没有spring-web和spring-webmvc,尝试手动添加

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

找到maven库里面的包

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

添加到对应的模块

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

添加成功

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

注意:选择的时候要选择到包里面的jar文件。

spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决

 到此这篇关于spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决的文章就介绍到这了,更多相关spring无法引入注解内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。