获取ApplicationContext.xml中的bean
BeanFactory factory = new ClassPathXmlApplicationContext("classpath:/applicationContext*.xml"); ITestService testService = (ITestService)factory.getBean("testService");
获取ApplicationContext.xml中的bean
BeanFactory factory = new ClassPathXmlApplicationContext("classpath:/applicationContext*.xml"); ITestService testService = (ITestService)factory.getBean("testService");