Package org.springframework.web.context

Examples of org.springframework.web.context.ContextCleanupListener


   
    // Register the Spring Context in the ServletContext
    sc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);

    // Manages the lifecycle
    sc.addListener(new ContextCleanupListener());
   
    // Filters
    sc.addFilter("OpenEntityInViewFilter", OpenEntityManagerInViewFilter.class).addMappingForUrlPatterns(null, true, "/*"); // Used for JPA, to ensure there's an EntityManager available
   
    log.debug("${artifactId} initialized.");
View Full Code Here


    ConfigurablePortletApplicationContext ac = initApplicationContext(WebApplicationContext.SCOPE_APPLICATION);
    assertNull(ac.getPortletContext().getAttribute(NAME));
    DerivedTestBean bean = ac.getBean(NAME, DerivedTestBean.class);
    assertSame(bean, ac.getPortletContext().getAttribute(NAME));
    assertSame(bean, ac.getBean(NAME));
    new ContextCleanupListener().contextDestroyed(new ServletContextEvent(ac.getServletContext()));
    assertTrue(bean.wasDestroyed());
  }
View Full Code Here

    WebApplicationContext ac = initApplicationContext(WebApplicationContext.SCOPE_APPLICATION);
    assertNull(ac.getServletContext().getAttribute(NAME));
    DerivedTestBean bean = ac.getBean(NAME, DerivedTestBean.class);
    assertSame(bean, ac.getServletContext().getAttribute(NAME));
    assertSame(bean, ac.getBean(NAME));
    new ContextCleanupListener().contextDestroyed(new ServletContextEvent(ac.getServletContext()));
    assertTrue(bean.wasDestroyed());
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.context.ContextCleanupListener

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.