Code example for XmlBeanFactory

0
		readXmlWebRootForContext(); // 初始华spring 
	} 
 
	public static void readXml2() { 
		Resource cr = new ClassPathResource("applicationContext.xml");
		BeanFactory bf = new XmlBeanFactory(cr);
 
	} 
 
	// 读class目录下面的配置文件 
	public static BeanFactory readXMlClassPathToBeanFactory() {
		// ApplicationContext 
		ClassPathXmlApplicationContext resource = new ClassPathXmlApplicationContext(
				new String[] { "/applicationContext.xml" });
		BeanFactory factory = resource;
 
		return factory;
 
	}