List of usage examples for org.springframework.web.context.support XmlWebApplicationContext start
@Override
public void start()
From source file:com.predic8.membrane.servlet.RouterUtil.java
public static Router initializeRoutersFromSpringWebContext(XmlWebApplicationContext appCtx, final ServletContext ctx, String configLocation) { appCtx.setServletContext(ctx);//from w w w . j a v a2s . c om appCtx.setConfigLocation(configLocation); appCtx.refresh(); Collection<Router> routers = appCtx.getBeansOfType(Router.class).values(); Router theOne = null; for (Router r : routers) { r.getResolverMap().addSchemaResolver(new FileSchemaWebAppResolver(ctx)); if (r.getTransport() instanceof ServletTransport) { if (theOne != null) throw new RuntimeException("Only one <router> may have a <servletTransport> defined."); theOne = r; } } appCtx.start(); return theOne; }