### 2.6 使用Spring的API获得Bean实例
```java
@Test
public void test1(){
ApplicationContext applicationContext = new
ClassPathXmlApplicationContext("applicationContext.xml");
UserDao userDao = (UserDao) applicationContext.getBean("userDao"); userDao.save();
}
```
|
|