简体   繁体   English

如何将Java转换为Spring XML bean

[英]How to convert java to Spring XML bean

We have a java web project with initial configuration in Spring applicationContext.xml. 我们在Spring applicationContext.xml中有一个带有初始配置的Java Web项目。 Please don't write that it is old style, I know. 我知道,请不要写出它是旧样式。 Part of this configurations can be change vs admin panel of the application and we need to backup it from time to time. 此配置的一部分可以通过应用程序的“更改与管理”面板进行更改,我们需要不时进行备份。 Does spring have something like applicationContext.saveBean() or any any other way to save configuration objects into XML using Spring beans? spring是否具有诸如applicationContext.saveBean()之类的东西,或使用Spring bean将配置对象保存为XML的任何其他方式?

You can use Spring caching with Ehcache: 您可以将Spring缓存与Ehcache结合使用:

https://github.com/eugenp/tutorials/tree/master/spring-all https://github.com/eugenp/tutorials/tree/master/spring-all

You are getting the option of caching on disk stores. 您可以选择在磁盘存储上进行缓存。 You also can persist your beans as java serialized objects. 您还可以将bean持久化为java序列化对象。 Of course this doesn't generate an xml readable output. 当然,这不会生成xml可读的输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM