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
精彩评论