List of usage examples for org.springframework.web.context ConfigurableWebApplicationContext getResources
Resource[] getResources(String locationPattern) throws IOException;
From source file:edu.jhuapl.openessence.config.AppInitializer.java
private void addPropertySources(ConfigurableWebApplicationContext ctx) { ConfigurableEnvironment env = ctx.getEnvironment(); // add properties that don't come from .properties files env.getPropertySources().addFirst(getBuiltinPropertySource(ctx)); try {/*w w w .java2s . c o m*/ Resource[] classpathPropResources = ctx.getResources("classpath:/config/*.properties"); for (PropertySource<?> p : getPropertySources(Arrays.asList(classpathPropResources))) { env.getPropertySources().addFirst(p); } } catch (IOException e) { throw new IllegalStateException(e); } }