Im trying to create a Java properties file in the format
api.base=http://example.com/api
api.get_posts=<dynamic_value_for_api_base>/get_posts
Im not quite sure if its possible, but I’ve definitely seen it done before (although it might have been done using Ant). Is there something I can do in this instance, in the properties file, without having to do it programmatically in Java?
Thanks
Stephen
What you would have seen would be an ant or maven filter.
It is possible to have variables set at build time using this.
What your are talking about doesn’t occur in the resource loaders that would read the propery files with out code in place.
Additionally ofcourse if you are writing the java to read the property to implement pattern matching to support this.
No one bothers usually as it is easier to either do it at build time with filters and mvn or ant or just write the code not to need redundant configuration blocks that would benefit from dynamic content.