I’m using a properties file to store configuration information for a webapp. I’d like to allow the user to set certain values via the webapp. I’m just wondering where I should place it?
I’m using a properties file to store configuration information for a webapp. I’d like
Share
I see this is tagged with
Spring. Have you looked at the PropertyPlaceHolderConfigurer ?This can be used to specify multiple property files used to expand properties in the Spring configs. You can use this to (say) specify a properties file on the classpath (in your app bundle) and an optional overriding properties file in (say) the user’s home dir.
That way you can provide defaults in the app, and override using optional properties files in the user’s home directory, the
/etc/filesystem etc. This is what I typically do, providing locations for different prperties files that are user-editable (in/home) and admin editable (in/etc).I appreciate that this doesn’t quite answer your question, but gives you new options for what you really want to achieve.