List of usage examples for org.springframework.web.context.support GenericWebApplicationContext getEnvironment
@Override
public ConfigurableEnvironment getEnvironment()
From source file:fr.letitzen.demo.web.GenericWebXmlContextLoader.java
public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { GenericWebApplicationContext context = new GenericWebApplicationContext(); context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles()); prepareContext(context);/*ww w .ja v a2s . c o m*/ new XmlBeanDefinitionReader(context).loadBeanDefinitions(mergedConfig.getLocations()); AnnotationConfigUtils.registerAnnotationConfigProcessors(context); context.refresh(); context.registerShutdownHook(); return context; }
From source file:com.example.springsecurity.web.controllers.GenericWebContextLoader.java
public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { GenericWebApplicationContext context = new GenericWebApplicationContext(); context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles()); prepareContext(context);/* w w w. ja v a 2 s .c o m*/ loadBeanDefinitions(context, mergedConfig); return context; }
From source file:mx.edu.um.mateo.general.test.GenericWebXmlContextLoader.java
@Override public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { GenericWebApplicationContext context = new GenericWebApplicationContext(); context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles()); prepareContext(context);//from w w w . j a v a2s . com new XmlBeanDefinitionReader(context).loadBeanDefinitions(mergedConfig.getLocations()); AnnotationConfigUtils.registerAnnotationConfigProcessors(context); context.refresh(); context.registerShutdownHook(); return context; }