/** * Initialize the root web application context. */ @Override public void contextInitialized(ServletContextEvent event) { initWebApplicationContext(event.getServletContext()); }
/** * Initialize the root web application context. */ @Override public void contextInitialized(ServletContextEvent event) { initWebApplicationContext(event.getServletContext()); }
/** * Initialize the root web application context. */ @Override public void contextInitialized(ServletContextEvent event) { initWebApplicationContext(event.getServletContext()); }
/** * Initialize the root web application context. */ @Override public void contextInitialized(ServletContextEvent event) { initWebApplicationContext(event.getServletContext()); }
@Override public void onStartup(final ServletContext servletContext) throws ServletException { final ContextLoaderListener listener = servletContext.createListener(ContextLoaderListener.class); listener.initWebApplicationContext(servletContext); final ApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); environmentVars = context.getBean("envVars", EnvironmentVars.class); }
MockServletContext mockServletContext = new MockServletContext(); mockServletContext.addInitParameter("contextConfigLocation", "path to your xml config")); ContextLoaderListener listener = new ContextLoaderListener(); listener.initWebApplicationContext(mockServletContext);
try { LOG.debug("Attempting to initialise the Spring ApplicationContext"); context = super.initWebApplicationContext(servletContext); } catch (Throwable t) { String message = "The Spring WebApplicationContext could not be started";