在 java 中加载 Web 应用程序特定配置和设置的首选方法是什么

发布于 2024-10-06 04:26:55 字数 168 浏览 0 评论 0原文

我想知道您在 Web 应用程序中加载应用程序设置的常用方法是什么。我只是环顾四周,因为我只需要一次,并且我们要求用户指定环境变量,并将路径设置为我们在 spring 上下文中加载的配置文件。我的观点不是加载(无论是xml还是属性)而是文件的位置和定位,您认为首选方式是什么。

问候,

马雷克

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

听不够的曲调 2024-10-13 04:26:55

properties 文件放在用户主目录中是一个不错的选择

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

半﹌身腐败 2024-10-13 04:26:55

这取决于情况,但将设置存储在本地属性文本文件中或数据库表中是两种常见的方法。

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

请你别敷衍 2024-10-13 04:26:55

我们通常在上下文描述符中填充 JNDI 环境。

We usually populate the JNDI environment in the context descriptor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文