springboot注入静态变量

springboot注入静态变量,第1张

springboot注入静态变量
public class Test{
	public static String remoteUrl; 
	public static AService aService; 
 
	@Value("${remote-url}")
	public void setRemoteUrl(String remoteUrl){
		Test.remoteUrl=remoteUrl;
	}
	
	@Autowired
	public void setAService(AService aService){
		Test.aService=aService;
	}

}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4829194.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-10
下一篇 2022-11-10

发表评论

登录后才能评论

评论列表(0条)

保存