org.springframework.web.context.ServletConfigAware Java Examples

The following examples show how to use org.springframework.web.context.ServletConfigAware. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServletContextAwareProcessor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
	if (getServletContext() != null && bean instanceof ServletContextAware) {
		((ServletContextAware) bean).setServletContext(getServletContext());
	}
	if (getServletConfig() != null && bean instanceof ServletConfigAware) {
		((ServletConfigAware) bean).setServletConfig(getServletConfig());
	}
	return bean;
}
 
Example #2
Source File: StaticWebApplicationContext.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #3
Source File: AbstractRefreshableWebApplicationContext.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #4
Source File: ServletContextAwareProcessor.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
	if (getServletContext() != null && bean instanceof ServletContextAware) {
		((ServletContextAware) bean).setServletContext(getServletContext());
	}
	if (getServletConfig() != null && bean instanceof ServletConfigAware) {
		((ServletConfigAware) bean).setServletConfig(getServletConfig());
	}
	return bean;
}
 
Example #5
Source File: StaticWebApplicationContext.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #6
Source File: AbstractRefreshableWebApplicationContext.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #7
Source File: ServletContextAwareProcessor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
	if (getServletContext() != null && bean instanceof ServletContextAware) {
		((ServletContextAware) bean).setServletContext(getServletContext());
	}
	if (getServletConfig() != null && bean instanceof ServletConfigAware) {
		((ServletConfigAware) bean).setServletConfig(getServletConfig());
	}
	return bean;
}
 
Example #8
Source File: StaticWebApplicationContext.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #9
Source File: AbstractRefreshableWebApplicationContext.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #10
Source File: ServletContextAwareProcessor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
	if (getServletContext() != null && bean instanceof ServletContextAware) {
		((ServletContextAware) bean).setServletContext(getServletContext());
	}
	if (getServletConfig() != null && bean instanceof ServletConfigAware) {
		((ServletConfigAware) bean).setServletConfig(getServletConfig());
	}
	return bean;
}
 
Example #11
Source File: StaticWebApplicationContext.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}
 
Example #12
Source File: AbstractRefreshableWebApplicationContext.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
 */
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
	WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
}