spring从容器中取bean

 @Service
public class CommandServiceImpl implements ICommandService{
@Autowired
ApplicationContext applicationContext;
......
//从容器中获取指令实现类实例
Object o=applicationContext.getBean("xxx"); 


原文地址:https://www.cnblogs.com/danghuijian/p/4399996.html