仔细查看maven构建的输入日志后,发现是因为在这个org.springframework.web.bind.annotation
包没有导入成功。要怎么才能导入这个包?后面再Stack Overflow上找到一个回答,成功地解决了问题。回答如下:
I had the same problem. After spending hours, I came across the solution that
I already added dependency for “spring-webmvc” but missed for “spring-web”. So
just add the below dependency to resolve this issue. If you already have, just
update both to the latest version. It will work for sure.
检查是否漏掉了这个依赖,漏掉了的话先加上,然后再试试看。
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</
artifactId> <version>4.1.6.RELEASE</version> </dependency>
热门工具 换一换