org.springframework.web.context.support
public class: ServletContextAwareProcessor [javadoc |
source]
java.lang.Object
org.springframework.web.context.support.ServletContextAwareProcessor
All Implemented Interfaces:
BeanPostProcessor
org.springframework.beans.factory.config.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.
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.springframework.web.context.support.ServletContextAwareProcessor Detail: |
public Object postProcessAfterInitialization(Object bean,
String beanName) {
return bean;
}
|
public Object postProcessBeforeInitialization(Object bean,
String beanName) throws BeansException {
if (this.servletContext != null && bean instanceof ServletContextAware) {
((ServletContextAware) bean).setServletContext(this.servletContext);
}
if (this.servletConfig != null && bean instanceof ServletConfigAware) {
((ServletConfigAware) bean).setServletConfig(this.servletConfig);
}
return bean;
}
|