Package org.springframework.web.context.support

Examples of org.springframework.web.context.support.ServletContextAwareProcessor


    assertEquals(servletConfig, bean.getServletConfig());
  }

  public void testServletConfigAwareWithNonNullServletContextAndNullServletConfig() {
    ServletContext servletContext = new MockServletContext();
    ServletContextAwareProcessor processor = new ServletContextAwareProcessor(servletContext, null);
    ServletConfigAwareBean bean = new ServletConfigAwareBean();
    assertNull(bean.getServletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNull(bean.getServletConfig());
  }
View Full Code Here


    assertNull(bean.getServletConfig());
  }

  public void testServletConfigAwareWithNullServletContext() {
    ServletContext servletContext = null;
    ServletContextAwareProcessor processor = new ServletContextAwareProcessor(servletContext);
    ServletConfigAwareBean bean = new ServletConfigAwareBean();
    assertNull(bean.getServletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNull(bean.getServletConfig());
  }
View Full Code Here

        }
    }
   
  @Override
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext));
        beanFactory.ignoreDependencyInterface(ServletContextAware.class);
        beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

        WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
        WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext);
View Full Code Here

   * 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);

View Full Code Here

TOP

Related Classes of org.springframework.web.context.support.ServletContextAwareProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.