Created
February 6, 2012 14:28
-
-
Save eugenp/1752360 to your computer and use it in GitHub Desktop.
Properties with Spring - Register Property manually in Java with Spring 3.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public static PropertySourcesPlaceholderConfigurer properties(){ | |
PropertySourcesPlaceholderConfigurer pspc = | |
new PropertySourcesPlaceholderConfigurer(); | |
Resource[] resources = new ClassPathResource[ ] | |
{ new ClassPathResource( "foo.properties" ) }; | |
pspc.setLocations( resources ); | |
pspc.setIgnoreUnresolvablePlaceholders( true ); | |
return pspc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment