spring的bean工厂的产生

http://sourceforge.net/projects/springframework      (spring 的下载链接)

 

Resource resource=new  ClassPathResource("appcontext.xml");

BeanFactory  factory=new XmlBeanFactory(resource);

HelloWorld helloWorld =(HelloWorld) factory.getBean("beanName");

你可能感兴趣的:(spring,bean)