开发者

What's the best method to use a configuration file?

开发者 https://www.devze.com 2023-03-02 16:33 出处:网络
.properties? .xml? What is the best method to have a configuration in a website? In my case I need to have some variables, for example

.properties? .xml?

What is the best method to have a configuration in a website? In my case I need to have some variables, for example

server_home = "http://si开发者_如何学Gote.com"

site_name = "website's name"

default_language = "en"

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

Spring supports something?


The easiest way is to use a ".properties" file, along side with Spring's PropertyPlaceHolderConfigurer. Check out the javadoc http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html

0

精彩评论

暂无评论...
验证码 换一张
取 消