Skip to content

Instantly share code, notes, and snippets.

@eugenp
Created October 19, 2011 20:50
Show Gist options
  • Save eugenp/1299624 to your computer and use it in GitHub Desktop.
Save eugenp/1299624 to your computer and use it in GitHub Desktop.
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 1 - the AppConfig
@Configuration
@ImportResource( { "classpath*:/rest_config.xml" } )
@ComponentScan( basePackages = "org.rest" )
public class AppConfig{
@Bean
public static PropertyPlaceholderConfigurer properties(){
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
final Resource[] resources = new ClassPathResource[ ] {
new ClassPathResource( "persistence.properties" ),
new ClassPathResource( "restfull.properties" )
};
ppc.setLocations( resources );
ppc.setIgnoreUnresolvablePlaceholders( true );
return ppc;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment