What's the preferred way to load web applicati

2019-06-14 13:48发布

问题:

I was wondering what is the usual way for you to load application settings in web applications. I'm just looking around because I had only needed this once and we required user to specify environment variable with path set to the configuration file which we loaded in the spring context. My point is not the loading (whether xml or properties) but the location and locating of the file, what do you think is the preferred way.

Regards,

Marek

回答1:

Placing properties file in User's home directory is a good option



回答2:

It depends, but storing settings either in a properties text file locally, or in a database table are two common ways.



回答3:

We usually populate the JNDI environment in the context descriptor.