You could use a default value:
@Value("${prop1:}")
public String prop1;
and spring will inject an empty string if the property isn’t defined. The syntax is ${property:defaultValue}.
You could use a default value:
@Value("${prop1:}")
public String prop1;
and spring will inject an empty string if the property isn’t defined. The syntax is ${property:defaultValue}.