spring配置Bean class HelloWorld{ message; } 在bean.xml中配置 获取bean ApplicationContext context=new ClassXmlApplicationContext("beans.xml"); HelloWorld helloworld=(HelloWorld)context.getBean("helloBean"); 然后就可以使用该对象了。 在类中List holidays; ....