Spring @PropertySource example @Bean public static PropertySourcesPlaceholderConfigurer propertyConfigInDev...

Please Visit: http://ift.tt/1ajReyV



Spring @PropertySource example

@Bean

public static PropertySourcesPlaceholderConfigurer propertyConfigInDev() {

return new PropertySourcesPlaceholderConfigurer();

}

@Autowired

private Environment env;

env.getProperty("mongodb.url");

4.2 Allow @PropertySource to ignore the not found properties file.

@PropertySources({

@PropertySource(value= "classpath:missing.properties", ignoreResourceNotFound=true),

@PropertySource("classpath:config.properties")

})

http://ift.tt/1ydIB4B






from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1GEMSr9

via LifeLong Community

No comments:

Post a Comment