.属性? .xml?
在网站中进行配置的最佳方法是什么? 就我而言,我需要一些变量,例如
server_home =“http://site.com”
site_name = "网站名称"
默认语言=“en”
images_folder =“/var/images/...” ...
Spring 支持什么?
最佳答案
最简单的方法是使用“.properties”文件以及 Spring 的 PropertyPlaceHolderConfigurer
。查看 javadoc http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html
关于java - 使用配置文件的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5849938/