当前位置: 首页>>代码示例>>Java>>正文


Java ServletConfigAware类代码示例

本文整理汇总了Java中org.springframework.web.context.ServletConfigAware的典型用法代码示例。如果您正苦于以下问题:Java ServletConfigAware类的具体用法?Java ServletConfigAware怎么用?Java ServletConfigAware使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServletConfigAware类属于org.springframework.web.context包,在下文中一共展示了ServletConfigAware类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postProcessBeanFactory

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AbstractRefreshableWebApplicationContext.java

示例2: postProcessBeforeInitialization

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
@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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ServletContextAwareProcessor.java

示例3: postProcessBeanFactory

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    SdcctServletConfig servletConfig = new SdcctServletConfig();
    this.setServletConfig(servletConfig);

    beanFactory.registerSingleton(AbstractRefreshableWebApplicationContext.SERVLET_CONFIG_BEAN_NAME, servletConfig);
    beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

    super.postProcessBeanFactory(beanFactory);
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:11,代码来源:SdcctWebApplicationContext.java

示例4: postProcessBeanFactory

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    CrigttServletConfig servletConfig = new CrigttServletConfig();
    this.setServletConfig(servletConfig);
    
    beanFactory.registerSingleton(AbstractRefreshableWebApplicationContext.SERVLET_CONFIG_BEAN_NAME, servletConfig);
    beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

    super.postProcessBeanFactory(beanFactory);
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:11,代码来源:CrigttWebApplicationContext.java

示例5: postProcessBeforeInitialization

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
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;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:10,代码来源:ServletContextAwareProcessor.java

示例6: postProcessBeanFactory

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * 
 * Registers request/session scopes, a {@link ServletContextAwareProcessor},
 * etc.
 */
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	super.postProcessBeanFactory(beanFactory);

	beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
	beanFactory.ignoreDependencyInterface(ServletContextAware.class);
	beanFactory.ignoreDependencyInterface(ServletConfigAware.class);
	beanFactory.registerResolvableDependency(ServletContext.class, this.servletContext);
	beanFactory.registerResolvableDependency(ServletConfig.class, this.servletConfig);

	WebApplicationContextUtils.registerWebApplicationScopes(beanFactory);
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:18,代码来源:OsgiBundleXmlWebApplicationContext.java

示例7: testPostProcessBeanFactoryConfigurableListableBeanFactory

import org.springframework.web.context.ServletConfigAware; //导入依赖的package包/类
public void testPostProcessBeanFactoryConfigurableListableBeanFactory() {

		ConfigurableListableBeanFactory mock = new DefaultListableBeanFactory() {

			public void ignoreDependencyInterface(Class ifc) {
				ignored.add(ifc);
			}

			public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) {
				super.addBeanPostProcessor(beanPostProcessor);
				bpp.add(beanPostProcessor.getClass());
			}

			public void registerResolvableDependency(Class dependencyType, Object autowiredValue) {
				super.registerResolvableDependency(dependencyType, autowiredValue);
				resolved.add(dependencyType);
			}
		};

		context.postProcessBeanFactory(mock);

		assertTrue(ignored.contains(ServletConfigAware.class));
		assertTrue(ignored.contains(ServletContextAware.class));
		assertTrue(resolved.contains(ServletContext.class));
		assertTrue(resolved.contains(ServletConfig.class));
		assertTrue(bpp.contains(ServletContextAwareProcessor.class));
	}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:28,代码来源:OsgiBundleXmlWebApplicationContextTest.java


注:本文中的org.springframework.web.context.ServletConfigAware类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。