List of usage examples for org.springframework.web.context ContextLoaderListener setContextInitializers
@SuppressWarnings("unchecked") public void setContextInitializers(@Nullable ApplicationContextInitializer<?>... initializers)
From source file:org.springframework.web.context.AbstractContextLoaderInitializer.java
/** * Register a {@link ContextLoaderListener} against the given servlet context. The * {@code ContextLoaderListener} is initialized with the application context returned * from the {@link #createRootApplicationContext()} template method. * @param servletContext the servlet context to register the listener against *//*from ww w . ja va 2 s . c o m*/ protected void registerContextLoaderListener(ServletContext servletContext) { WebApplicationContext rootAppContext = createRootApplicationContext(); if (rootAppContext != null) { ContextLoaderListener listener = new ContextLoaderListener(rootAppContext); listener.setContextInitializers(getRootApplicationContextInitializers()); servletContext.addListener(listener); } else { logger.debug("No ContextLoaderListener registered, as " + "createRootApplicationContext() did not return an application context"); } }