What's the preferred way to load web application specific configuration and settings in java

萝らか妹 提交于 2019-12-08 10:42:17

问题


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.



来源:https://stackoverflow.com/questions/4379607/whats-the-preferred-way-to-load-web-application-specific-configuration-and-sett

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!