留言与评论(共有 0 条评论) |
发布时间:2020-04-15 16:12:19
因为这个现成不受spring容器的监管,所以无法注入bean。采用如下方法:
以下是例子:
ApplicationContext ctx = new AnnotationConfigApplicationContext(BulletinService.class);
BulletinServicebulletinService= ctx.getBean(BulletinService.class);
试试吧。
留言与评论(共有 0 条评论) |
全站搜索