Skip to content

Instantly share code, notes, and snippets.

@eugenp
Created February 6, 2012 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugenp/1752360 to your computer and use it in GitHub Desktop.
Save eugenp/1752360 to your computer and use it in GitHub Desktop.
Properties with Spring - Register Property manually in Java with Spring 3.1
@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