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
ModifierConstructorDescriptionprotected
Create a new ServletContextAwareProcessor without an initial context or config.ServletContextAwareProcessor
(ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given config.ServletContextAwareProcessor
(ServletContext servletContext) Create a new ServletContextAwareProcessor for the given context.ServletContextAwareProcessor
(ServletContext servletContext, ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given context and config. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServletConfig
Returns theServletConfig
to be injected ornull
.protected ServletContext
Returns theServletContext
to 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 theServletContext
to be injected ornull
. This method can be overridden by subclasses when a context is obtained after the post-processor has been registered. -
getServletConfig
Returns theServletConfig
to be injected ornull
. This method can be overridden by subclasses when a context is obtained after the post-processor has been registered. -
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessBeforeInitialization
in interfaceorg.springframework.beans.factory.config.BeanPostProcessor
- Throws:
org.springframework.beans.BeansException
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitialization
in interfaceorg.springframework.beans.factory.config.BeanPostProcessor
-