1、可以參考struts的docs文檔spring-plugin.html。
2、也可以參考spring的幫助文檔的15.4節(jié)struts。
<listener> <listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class></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>
默認(rèn)的路徑是>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml,也可以把spring的配置文件放到src目錄下,配置就是classpath:beans.xml。其中beans.xml是文件名。
原幫助文檔的描述:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans default-autowire="autodetect"> <bean id="personManager" class="com.acme.PersonManager"/> ...</beans>
![]() | More applicationContext configuration filesneeded? Since the Spring integration uses a standard Listener, it can beconfigured to support configuration files other thanapplicationContext.xml. Adding the following to yourweb.xml will cause Spring's ApplicationContext to be inititalizedfrom all files matching the given pattern: <!-- Context Configuration locations for Spring XML files --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value></context-param> See the Spring documentation for a full description of thisparameter. |
注意:
如果beans.xml文件放在src目錄下,在生成ApplicationContextctx=newClassPathXmlApplicationC
聯(lián)系客服