开发者

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

.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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜