Skip to main content

Posts

Showing posts from February, 2018

Soothing songs that will relax mind..

Do give it a try.. https://www.youtube.com/watch?v=UNN-r70cip8 https://www.youtube.com/watch?v=rLCMBlST8yk https://www.youtube.com/watch?v=4ZHwu0uut3k   https://www.youtube.com/watch?v=s_Vg5NN7LBo   https://www.youtube.com/watch?v=RCMXO9sBIcU   https://www.youtube.com/watch?v=8DSeZji2x-Y https://www.youtube.com/watch?v=KFppTBdCse8 https://www.youtube.com/watch?v=ocH-aauM_wU https://www.youtube.com/watch?v=qigaJOTqpWE https://www.youtube.com/watch?v=AbWBviQCMEE https://www.youtube.com/watch?v=5Y5xjtNltJA https://www.youtube.com/watch?v=NgBQJDQbeFA https://www.youtube.com/watch?v=fauGWTbto4k   https://www.youtube.com/watch?v=iNxvE-NvX-A https://www.youtube.com/watch?v=E1foE6xq66k https://www.youtube.com/watch?v=Gdg5HqX_vZE   There is more to this list.

Reading Property Files in a Spring Framework in Java

Reading Property Files in a Spring Framework in Java Of the many ways possible to achieve this in  a Java based Project, they can be classified into 2 categories based on the nature of configuration, namely Annotation Based and Xml based. Annotation Based: Use @PropertySource("classpath:fileName.properties") @Configuration @ComponentScan(basePackages = { "com.myproject.*" }) @PropertySource("classpath:dbConfig.properties") public class GetDBConnection { ... } Read Property File Data using either Environment or @Value METHOD 1 - Using Environment: @Autowired private Environment env; String dbUrl = env.getProperty("db.url"); Using @Value @Value("${db.url}") // To be bound with an attribute private String dbUrl; //To resolve ${} in @Value, use PropertySourcesPlaceholderConfigurer. @Bean public static PropertySourcesPlaceholderConfigurer propertyConfigInDev() {         return new PropertySourcesPlaceholderC