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 jakarta.servlet.ServletContext servletContext, @Nullable jakarta.servlet.ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given context and config.ServletContextAwareProcessor(jakarta.servlet.ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given config.ServletContextAwareProcessor(jakarta.servlet.ServletContext servletContext) Create a new ServletContextAwareProcessor for the given context. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable jakarta.servlet.ServletConfigReturns theServletConfigto be injected ornull.protected @Nullable jakarta.servlet.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
public ServletContextAwareProcessor(jakarta.servlet.ServletContext servletContext) Create a new ServletContextAwareProcessor for the given context. -
ServletContextAwareProcessor
public ServletContextAwareProcessor(jakarta.servlet.ServletConfig servletConfig) Create a new ServletContextAwareProcessor for the given config. -
ServletContextAwareProcessor
-
-
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
-