在进行maven+spring+struts+hibernate整合时发生class path resource [spring.xml] cannot be opened because it do及BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext找不到bean错误时,在web.XML中加入
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml,classpath*:applicationContext*.xml</param-value>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml,classpath*:applicationContext*.xml</param-value>
</context-param>
在classpath后面加*,因为classpath默认路径不是src下的resource文件