@Override public void contextInitialized(ServletContextEvent event) { super.contextInitialized(event); ApplicationContext appContext = getCurrentWebApplicationContext(); if (appContext != null) { appContext.publishEvent(new ContextLoadedEvent(appContext)); } } }
GeoServer.class, ((ContextLoadedEvent) event).getApplicationContext()); listener = new ConfigurationListenerAdapter() {
applicationContext.setUseLegacyGeoServerLoader(false); applicationContext.refresh(); applicationContext.publishEvent(new ContextLoadedEvent(applicationContext));
applicationContext.setUseLegacyGeoServerLoader(useLegacyDataDirectory()); applicationContext.refresh(); applicationContext.publishEvent(new ContextLoadedEvent(applicationContext));
applicationContext.setUseLegacyGeoServerLoader(false); applicationContext.refresh(); applicationContext.publishEvent(new ContextLoadedEvent(applicationContext)); servletContext.setAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, applicationContext);