简体   繁体   English

在application.conf中包含的conf文件中使用Play Server的ID

[英]Use ID of Play Server in a conf file included in application.conf

Let's say I have a conf file called extra.conf. 假设我有一个名为extra.conf的conf文件。 I add it to the Play Server's application.conf like this: 我将它添加到Play服务器的application.conf中,如下所示:

@include.extra = extra.conf

And extra.conf looks like this: 而extra.conf看起来像这样:

foo=bar

The following code returns bar as expected: 以下代码按预期返回bar

Play.configuration.getProperty("foo");

However, if I want to prefix the property with the server id like this: 但是,如果我想在属性前添加服务器ID,如下所示:

%someid.foo=bar

and start the server with the above id: 并使用以上id启动服务器:

play run --%someid

The code can no longer obtain the foo property. 代码无法再获取foo属性。

If I move %someid.foo=bar directly into the application.conf instead of having it in the extra.conf file, it works again. 如果我将%someid.foo=bar直接移到application.conf而不是在extra.conf文件中,它会再次运行。

Does anyone know whether it is possible to get the original scenario to work where I prefix a property with the server id and have that property included via a conf file which is not application.conf? 有没有人知道是否有可能让原始场景工作在我用服务器ID作为前缀的属性,并通过conf文件包含该属性而不是application.conf?

It sounds to be a bug. 这听起来像是一个bug。 You should submit it on play.lighthouseapp.com 你应该在play.lighthouseapp.com上提交

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

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