ianaz
ianaz

Reputation: 2580

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://site.com"

site_name = "website's name"

default_language = "en"

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


Spring supports something?

Upvotes: 1

Views: 90

Answers (1)

CarlosZ
CarlosZ

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

Related Questions