2
启动类中用@value获取配置信息
source link: http://www.hechunbo.com/index.php/archives/427.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
启动类中用@value获取配置信息
private static String newone;
@Value("${newone}")
public void setNewone(String value) {
newone = value;
}
main方法
SpringApplication.run(GatewayApplication.class, args);
System.out.println("启动成功");
System.out.println("newone="+newone);
本文由 hcb 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK