package com.ssm.di.xml;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestXML {
public static void main(String[] args) {
    //1.初始化Spring容器，加载配置文件
    ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean-di-xml.xml");

    //获得Budget对象
    Budget budget = (Budget) applicationContext.getBean("budget");
    //输出Budget实例的信息
    System.out.println(budget.toString());
    // 获取Notice Bean
    Notice notice = (Notice) applicationContext.getBean("notice");
    System.out.println(notice.toString());
    //获取Dict对象
    Dict dict = (Dict) applicationContext.getBean("dict");
    //输出Dict实例的信息
    System.out.println(dict.toString());

}
}
