来自数据库的Spring配置 [英] Spring configuration from database

查看:77
本文介绍了来自数据库的Spring配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序被部署了120次,每个应用程序的配置略有不同.我们希望将配置存储在数据库中,以进行审核和管理.

We have an application which is deployed 120 times with slightly different configurations for each. We would like the configuration to be stored in the database for auditing and management purposes.

如何在不使用XML的情况下直接从数据库实例化Spring Bean?

How can you instantiate Spring beans directly from the database without using XML?

谢谢

推荐答案

您不能将XML配置设为零(除非您使用JavaConfig,这对您而言并没有什么不同).您可以将其中的一些外部化到数据库中,并使用自定义的PropertyPlaceholderConfigurer.有关如何实现此目标的信息,请参见本文.

You can't have zero XML config (unless you use JavaConfig, which doesn't make things different in your case) . You can externalize some of it to the database, and use a custom PropertyPlaceholderConfigurer. See this article on how to achieve this.

这篇关于来自数据库的Spring配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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