Support "contextInitializerClasses" init-param
FrameworkServlet now has support equivalent to ContextLoader and its "contextInitializerClasses" context-param introduced in 3.1 M1. This allows users to specify ApplicationContextInitializers at the root (ContextLoader) level and/or at the DispatcherServlet level. Issue: SPR-8366
This commit is contained in:
@@ -20,6 +20,12 @@ package org.springframework.context;
|
||||
* Callback interface for initializing a Spring {@link ConfigurableApplicationContext}
|
||||
* prior to being {@linkplain ConfigurableApplicationContext#refresh() refreshed}.
|
||||
*
|
||||
* <p>Typically used within web applications that require some programmatic initialization
|
||||
* of the application context. For example, registering property sources or activating
|
||||
* profiles against the {@linkplain ConfigurableApplicationContext#getEnvironment()
|
||||
* context's environment}. See {@code ContextLoader} and {@code FrameworkServlet} support
|
||||
* for declaring a "contextInitializerClasses" context-param and init-param, respectively.
|
||||
*
|
||||
* <p>{@code ApplicationContextInitializer} processors are encouraged to detect
|
||||
* whether Spring's {@link org.springframework.core.Ordered Ordered} or
|
||||
* {@link org.springframework.core.PriorityOrdered PriorityOrdered} interfaces are also
|
||||
@@ -29,6 +35,8 @@ package org.springframework.context;
|
||||
* @since 3.1
|
||||
* @see org.springframework.web.context.ContextLoader#customizeContext
|
||||
* @see org.springframework.web.context.ContextLoader#CONTEXT_INITIALIZER_CLASSES_PARAM
|
||||
* @see org.springframework.web.servlet.FrameworkServlet#setContextInitializerClasses
|
||||
* @see org.springframework.web.servlet.FrameworkServlet#initializeWebApplicationContext
|
||||
*/
|
||||
public interface ApplicationContextInitializer<C extends ConfigurableApplicationContext> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user