struts2与spring整合的配置:
<!-- 1.配置spring监听,用于初始化spring -->
<listener><listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- 2.指定spring配置文件的位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-*.xml</param-value>
</context-param>
<!-- 3.struts2主控制配置 -->
<filter>
<filter-name>mvc</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>mvc</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>