1. 程式人生 > >Spring配置檔案的載入,及裝載多個beans.xml檔案

Spring配置檔案的載入,及裝載多個beans.xml檔案

public void testAutoWire() throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext("ioc/autoWire/beanAutoWire.xml");//載入包ioc.autoWire下面的beanAuthWire.xml檔案
UserService service = (UserService)ctx.getBean("userServiceAutoWire");
System.out.println(service.getUserDAOautoWire());