scope参数 singleton: scope默认参数,程序加载配置文件时(即执行ClassPathXmlApplicationContext())会创建 bean对象,且仅创建一个。 prototype 程序执行getBean()时创建对象,每执行一次getBean,都会创建一个bean对象