如果想要在Main方法中获得我们在spring容器中配置的bean的话,直接用ApplicationContext context = new ClassPathXMLContext("bean.xml");然后直接调用context.getbean();即可获得我们的bean对象