Spring 3.0 read values from property files

In Spring 2.0, we need to configure the property key in Spring bean configuration files
to read values from property files. Since Spring 3.0 is mostly annotation based, it is very simple to read values from property files.

Consider the following property file

file.properties

dir.location=C:\\tdd\\

To read the above property in java class use the following code

class FileController
{
        @Value("${dir.location}")
        private String directoryPath;
}
Technology: 

Search