Class ServletContextAwareProcessor
java.lang.Object
org.springframework.web.context.support.ServletContextAwareProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor
public class ServletContextAwareProcessor
extends Object
implements org.springframework.beans.factory.config.BeanPostProcessor
BeanPostProcessor
implementation that passes the ServletContext to beans that implement
the ServletContextAware interface.
Web application contexts will automatically register this with their underlying bean factory. Applications do not use this directly.
- Since:
- 12.03.2004
- Author:
- Juergen Hoeller, Phillip Webb
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new ServletContextAwareProcessor without an initial context or config.ServletContextAwareProcessor(@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given context and config.ServletContextAwareProcessor(ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given config.ServletContextAwareProcessor(ServletContext servletContext) Create a new ServletContextAwareProcessor for the given context. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ServletConfigReturns theServletConfigto be injected ornull.protected @Nullable ServletContextReturns theServletContextto be injected ornull.postProcessAfterInitialization(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName)
-
Constructor Details
-
ServletContextAwareProcessor
protected ServletContextAwareProcessor()Create a new ServletContextAwareProcessor without an initial context or config. When this constructor is used thegetServletContext()and/orgetServletConfig()methods should be overridden. -
ServletContextAwareProcessor
Create a new ServletContextAwareProcessor for the given context. -
ServletContextAwareProcessor
Create a new ServletContextAwareProcessor for the given config. -
ServletContextAwareProcessor
public ServletContextAwareProcessor(@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given context and config.
-
-
Method Details
-
getServletContext
Returns theServletContextto be injected ornull. This method can be overridden by subclasses when a context is obtained after the post-processor has been registered. -
getServletConfig
Returns theServletConfigto be injected ornull. This method can be overridden by subclasses when a context is obtained after the post-processor has been registered. -
postProcessBeforeInitialization
-
postProcessAfterInitialization
-