您的位置:首页 > 编程语言 > Java开发

SSH整合中出现的一些错误之 struts2下的“Exception starting filter struts2”

2012-03-24 15:49 573 查看
在整合SSH后即所有包都导入后,单独调试struts2出现了:

Exception starting filter struts2
错误

这种情况是由于我们引入了Spring的JAR包,但是确没有使用监听器,这样无法正常运行,我们需要再web.xml上加上

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<!--default:
默认情况下是找到 WEB-INF/applicationContext.xml
这里我们把beans.xml改为applicationContext.xml-->
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<!-- <param-value>/WEB-INF/applicationContext*.xml,classpath*:applicationContext*.xml</param-value>-->
<param-value>classpath:beans.xml</param-value>
</context-param>

同时我们还需要导入beans.xml的配置文件以及和beans.xml相关的一些配置文件,才能调试成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: