アプリケーションYMLなどで指定せずに、XMLでJavaのデフォルトプロパティ値を使用する方法を探しています。
これは私のJava構成であり、YMLファイルから提供されるまでこのURL値を使用したいデフォルトです。
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "test.sample")
public @Data class SampleProperties {
private String serverurl ="test.example.com";
}
XMLで使おうとすると
<property name="serverURL" value="${test.sample.serverurl}" />
投げ
IllegalArgumentException : Could not resolve placeholder 'test.sample.serverurl' in value "${test.sample.serverurl}"