在整合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相关的一些配置文件,才能调试成功