mscharhag, Programming and Stuff;

A blog about programming and software development topics, mostly focused on Java technologies including Java EE, Spring and Grails.

Wednesday, 9 September, 2020

Quick tip: Referencing other Properties in Spring

In Spring property (or yaml) files we can reference other properties using the ${..} syntax.

For example:

If we now access the external.productService property (e.g. by using the @Value annotation) we will get the value

For example:

private String productServiceUrl; //

This way we can avoid duplication of commonly used values in property and yaml files.

Leave a reply