Skip to content

Instantly share code, notes, and snippets.

View jbcpollak's full-sized avatar

Joshua Chaitin-Pollak jbcpollak

View GitHub Profile
@rponte
rponte / MyAppCtxInitializer.java
Created October 31, 2012 21:17
Configuring an ApplicationContextInitializer on Spring 3.1
public class MyAppCtxInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
private static Logger LOG = LoggerFactory.getLogger(MyAppCtxInitializer.class);
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
ConfigurableEnvironment environment = applicationContext.getEnvironment();
try {
environment.getPropertySources().addFirst(new ResourcePropertySource("classpath:env.properties"));
LOG.info("env.properties loaded");