在运行时更改jar / war文件中的config.properties文件并热部署更改? [英] change a config.properties file in a jar / war file in runtime and hotdeploy the changes?

查看:480
本文介绍了在运行时更改jar / war文件中的config.properties文件并热部署更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行时更改jar / war文件中的config.properties文件并热部署更改?
我的要求如下,我们在jar / war文件中有一个config.properties,我必须通过网页打开文件,在用户对其进行必要的更改后,我必须更新jar / war文件中的config.properties并热部署它。我们可以实现这一壮举吗?如果是这样,请指出相关的网站/文件,以便我可以快速启动。

change a config.properties file in a jar / war file in runtime and hotdeploy the changes ? my requirement is something as follows, we have a "config.properties" in a jar/war file , i have to open the file through a webpage and after the user has made necessary changes to it, i have to update the "config.properties" in jar/war file and hot deploy it. can we achieve this feat ? if so can you please point me to relevant sites/documents so that i can jumpstart on this.

推荐答案

我强烈建议你architecht重新考虑这个解决方案。您描述的内容应该通过JNDI或类似技术完成,而不是通过重新加载属性。

I will strongly recommend your architecht rethink this solution. What you describe should be done through JNDI or a similar technique, not through reloading properties.

部署应该被认为是静态的 - 任何给定的Web容器都不应该依赖魔术技巧,并且会在某一天中断(最有可能在最不方便的时候) 。

Deployments should be considered static - that any given web container allows for magic trickery should not be depended on, and WILL break some day (most likely at the most inconvenient time).

这篇关于在运行时更改jar / war文件中的config.properties文件并热部署更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆