1. java project
ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:bean1.xml","classpath:bean2.xml");
2. web project
<context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/beans.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
3. Test