为了将 JSF 与 Spring 集成,我在中添加了这些行web.xml
:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
我已经使用 Maven 添加了所有 spring 依赖项,但是当我运行该项目时,我收到以下错误消息:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener
当我看了一眼文件夹时/WEB-INF/lib
我没有找到 JAR 文件,尽管在pom.xml
.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
我认为问题是 JAR 没有与草案一起打包。
您知道如何解决它吗?
eclipse项目右键->属性->部署程序集->添加->Java构建路径条目就可以了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)