gpt4 book ai didi

eclipse - 找不到类 'org.springframework.web.servlet.view.InternalResourceViewResolver' 错误

转载 作者:行者123 更新时间:2023-12-05 01:25:44 24 4
gpt4 key购买 nike

我在使用 Spring STS Eclipse 插件的 Spring MVC 示例应用程序中遇到此错误:

Class 'org.springframework.web.servlet.view.InternalResourceViewResolver' not found [config set: webninar-hello/web-context]servlet-context.xml

有人知道如何解决这个问题吗?

最佳答案

我遇到这个问题是因为我的 maven 配置有误。正如 Ivan 在他的回答中提到的,org.springframework.web.servlet-3.1.2.RELEASE.jar 不在我的 lib 目录中。所以我从 http://blog.springsource.org/2009/12/02/obtaining-spring-3-artifacts-with-maven/ 中搜索了它的 Maven 依赖项。网址。

然后我意识到我在 pom.xml 中包含了错误的依赖项正确依赖如下

    <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>

以前我有 spring-web 作为 artifactId。希望这会有所帮助:)

关于eclipse - 找不到类 'org.springframework.web.servlet.view.InternalResourceViewResolver' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9531089/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com