三行代码看三月

package com.zby;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import com.zby.bean.CommonBean;

/**
 * 
 * @author zby
 * @date 2018年4月21日
 * @description
 */
@SuppressWarnings("deprecation")
public class AXmlBeanFactoryMain {

	public static void main(String[] args) {
		BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
		CommonBean commonBean = (CommonBean) beanFactory.getBean("commonBean");
		commonBean.sayHello();
	}

}

  有一起看的可以留言分享下经验或者有什么问题也可以留下大家一起解决。

猜你喜欢

转载自www.cnblogs.com/zby9527/p/9036384.html