【发布时间】:2011-09-19 01:22:53
【问题描述】:
假设我有一个名为 extra.conf 的 conf 文件。我将它添加到 Play Server 的 application.conf 中,如下所示:
@include.extra = extra.conf
extra.conf 看起来像这样:
foo=bar
以下代码按预期返回bar:
Play.configuration.getProperty("foo");
但是,如果我想在属性前加上这样的服务器 ID:
%someid.foo=bar
并使用上述 id 启动服务器:
play run --%someid
代码无法再获取 foo 属性。
如果我将%someid.foo=bar 直接移动到 application.conf 而不是将它放在 extra.conf 文件中,它会再次起作用。
有谁知道是否可以让原始场景工作,其中我在属性前加上服务器 ID,并通过不是 application.conf 的 conf 文件包含该属性?
【问题讨论】:
标签: java configuration playframework