2017-02-17 60 views
-1

是否可以在SDR中外部化rest-messages.properties? 例如,我试图将它移动到./config文件夹,但它不起作用。如何外部化Spring Data REST中的rest-messages.properties?

+0

大约需要5 sseconds给Google,并找到了答案:[来源/主/​​资源/ rest-default-messages.properties](https://github.com/spring-projects/spring-data-rest/ BLOB /主/弹簧数据休息-webmvc/src目录/主/资源/ rest-default-messages.properties) –

+0

我知道它 – Cepr0

回答

0

的rest-messages.properties(用于自定义详细信息添加到您的ALPS说明)进入到同一个位置,你会把定制的应用程序 - *的.properties或消息 - *属性文件。

例如,对于一个春天启动项目的属性文件都位于src /主/资源/目录。

您也可以为您的属性文件设置custom config locations

在OP的评论之后编辑:但是,我尝试在项目.jar之外使用自定义rest-messages.properties(正如我通常对application.properties所做的那样),它似乎不起作用。

+1

我没有问有关如何使用rest-messages.properties(我已经用它现在)。我问如何将其外化(如[外化Spring引导属性](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features -external-配置))。 – Cepr0

+0

我的不好。你能编辑这个问题以避免混淆吗?我会在同一时间研究它。 –

+0

我的问题有什么困惑?我问“如何** ** rest-messages.properties外部化?”。我犯了一个错误吗? – Cepr0

相关问题