【问题标题】:What's the best method to use a configuration file?使用配置文件的最佳方法是什么?
【发布时间】:2011-05-01 17:07:33
【问题描述】:

.属性? .xml?

在网站中进行配置的最佳方法是什么? 就我而言,我需要一些变量,例如

server_home = "http://site.com"

site_name = "网站名称"

default_language = "zh"

images_folder = "/var/images/..." ...


Spring 支持什么?

【问题讨论】:

    标签: java jsp spring-mvc jakarta-ee


    【解决方案1】:

    最简单的方法是使用“.properties”文件以及 Spring 的PropertyPlaceHolderConfigurer。查看 javadoc http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-25
      • 2017-05-29
      • 2011-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多