加载 bean.xml 的几种方式 (java or web project)

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

org.springframework spring-test

上一篇:Sql Server 公用表达式(CTE)


下一篇:Eclipse 快捷键使用