WebApplicationContext context = ContextLoaderListener.getCurrentWebApplicationContext(); LogService logService=context.getBean(LogService.class);
在普通类中获取spring管理的对象
最新推荐文章于 2023-01-03 17:43:15 发布
WebApplicationContext context = ContextLoaderListener.getCurrentWebApplicationContext(); LogService logService=context.getBean(LogService.class);