如何在其他几个属性中重用配置属性?我简化的现实示例如下所示:
myApp {
host = "www.myfoohost.com"
urls {
url1 = host + "/b" // this...
url2 = host + "/a" // ... and this do not work
}
}
答案 0 :(得分:4)
在Typesafe配置中调用substitutions,它使用${}
注释:
myApp {
host = "www.myfoohost.com"
urls {
url1 = ${myApp.host}"/b"
url2 = ${myApp.host}"/a"
}
}