原因两个:
1.lib中多导入包的大原因:去掉struts2-spring-plugin-2.1.8包即可,因为没有用到spring。
2.还有的原因是用spring了,却没加监听器,在web.xml里面加上
<!-- 通过上下文参数配置spring文件的位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml,classpath:schedules.xml</param-value>
</context-param>
<!-- 上下文载入器监听器,确保web服务器启动时,直接完成spring容器的初始化 将spring容器存放在application中 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>