IOC容器手动加载

手动加载IOC容器

ClassPathXmlApplicationContext context;
    public SMSSenderImplTest(){
        //--------------加载spring容器----------------//
        context = new ClassPathXmlApplicationContext(new String[] {
                "classpath:spring_echannel_dependence.xml",
                "classpath:spring_echannel.xml"
        });
        context.start();
    }

原文地址:https://www.cnblogs.com/nihaofenghao/p/5460673.html