Reputation: 2580
.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://site.com"
site_name = "website's name"
default_language = "en"
images_folder = "/var/images/..." ...
Spring supports something?
Upvotes: 1
Views: 90
Reputation: 8669
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
Upvotes: 1