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

来自:网络
时间:2022-08-05
阅读:

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

返回顶部
顶部