0

Can I get the value from a properties file where the value of the key to properties file entity is stored in a variable (contants Class)?

Structure is like: properties file

x.y.z=123     

Constant file

public static final String abc = "x.y.z";

Service class like

@Value(${"getConstant("abc").getValueOfProperty()})
public String resource;
pkgajulapalli
  • 1,066
  • 3
  • 20
  • 44

1 Answers1

0

I think, we can do like,

private final String VALUE_STRING = "${external.value:default}";
@Value(VALUE_STRING)
private String value;
Vivek
  • 376
  • 1
  • 14