本文主要介绍了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无法引入注解内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章