2017-02-17 63 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

相關問題