List of usage examples for org.springframework.web.context.support XmlWebApplicationContext setId
@Override
public void setId(String id)
From source file:br.com.caelum.vraptor.ioc.spring.DefaultSpringLocator.java
public ConfigurableWebApplicationContext getApplicationContext(ServletContext servletContext) { ConfigurableWebApplicationContext context = (ConfigurableWebApplicationContext) WebApplicationContextUtils .getWebApplicationContext(servletContext); if (context != null) { logger.info("Using a web application context: {}", context); return context; }/* ww w. j av a 2 s . c om*/ if (DefaultSpringLocator.class.getResource("/applicationContext.xml") != null) { logger.info("Using an XmlWebApplicationContext, searching for applicationContext.xml"); XmlWebApplicationContext ctx = new XmlWebApplicationContext(); ctx.setConfigLocation("classpath:applicationContext.xml"); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx); return ctx; } logger.info("No application context found"); ConfigurableWebApplicationContext ctx = new AnnotationConfigWebApplicationContext(); ctx.setId("VRaptor"); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx); return ctx; }