|
ApplicationContext ac = new ClassPathXmlApplicationContext("app-all.xml");
IAppService ips = (IAppService) ac.getBean("appService"); System.out.println(ips.getAllList()); |
java的main方法中调用spring的service
最新推荐文章于 2022-08-13 17:17:01 发布
本文介绍了如何使用ClassPathXmlApplicationContext加载配置文件,并通过getBean方法获取IAppService实例,最后调用getAllList方法进行演示。
973

被折叠的 条评论
为什么被折叠?



