简体   繁体   English

斯卡拉播放application.conf读取变量

[英]scala play application.conf read variables

Can I create variables in application.conf and consume by application.conf ? 我可以在application.conf创建变量并由application.conf吗? Basically I don't want to hard code it. 基本上,我不想对其进行硬编码。

I tried dominName = "test.com" and consume with $domainName but not working. 我尝试过dominName = "test.com"并使用$domainName消费,但无法正常工作。

You may need to use curly braces around the variable name: ${domainName} 您可能需要在变量名称周围使用花括号: ${domainName}

You can find more example and information about HOCON on this page 您可以在此页面上找到更多关于HOCON的示例和信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM