方法使用Lookup方式1、目标bean类Service Scope(prototype)public class ClientService{PostConstruct voidinit(){System.out.println(初始化示例);}public StringdoSomething(){return测试客户端代码;}}2、新建抽象类LookClientComponent public abstract class LookClient{Lookup public abstract ClientService getClientService();//该方法用于返回一个新的bean示例}3、使用注意要引入LookClient 而不要直接引入ClientService 因为是多实例呢Controller RestController RequestMapping(/business)public class BusinessController{Resource private LookClient lookClient;GetMapping(/hello)public Stringhello(){ClientServiceclookClient.getClientService();returnOK;}}