org.springframework.core.io.Resource res = new ClassPathResource("com/cec/bean.xml");
BeanFactory factory = new XmlBeanFactory(res);
SpringTest springTest = new SpringTest();这样new出来有什么用?
BeanFactory factory = new XmlBeanFactory(res);
SpringTest springTest = new SpringTest();这样new出来有什么用?
@service("springTest")
public class SpringTest {
第二步: ApplicationContext res = new FileSystemXmlApplicationContext(
"com/cec/bean.xml");
Test springTest = (Test) res.getBean("springTest")
for (HelloBeanInf t : springTest.getHelloBeanInfs()) {
((HelloBeanInf) t).test();
}