Examples of ContextLoaderListener


Examples of org.springframework.web.context.ContextLoaderListener

        context.setContextPath( "/" );

        context.setInitParameter( "contextConfigLocation", getSpringConfigLocation() );

        ContextLoaderListener contextLoaderListener = new ContextLoaderListener();

        context.addEventListener( contextLoaderListener );

        ServletHolder sh = new ServletHolder( CXFServlet.class );
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

    }

    public void test() throws Exception {
        ContextHandler context = new ContextHandler();
        context.setContextPath("/test");
        context.setEventListeners(new EventListener[] {new ContextLoaderListener()});
        Map initParams = new HashMap();
        initParams.put("contextConfigLocation", "classpath:org/apache/servicemix/web/http/spring-web.xml");
        initParams.put("contextClass", XmlWebApplicationContext.class.getName());
        context.setInitParams(initParams);
        ServletHolder holder = new ServletHolder();
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

      XmlWebApplicationContext webConfig = new XmlWebApplicationContext();
      webConfig.setConfigLocation("classpath:META-INF/restSimulatorContext.xml");
      webConfig.registerShutdownHook();

            List<EventListener> eventListeners = new ArrayList<EventListener>();
            eventListeners.add(new ContextLoaderListener(webConfig));
            eventListeners.add(new RequestContextListener());

            JettyHttpServerFactory.INSTANCE.startHttpServer(SINGLE_REST_SIMULATOR, servlets, filters, eventListeners, initParams);

//      ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
        // Register application config
        rootContext.register(AppConfig.class);

        // Manage the lifecycle of the root application context
        container.addListener(new ContextLoaderListener(rootContext));

        // Register Encoding Filter
        addEncodingFilter(container);

        // Register Logging Filter
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

        Context context = new Context(server, "/",  Context.NO_SESSIONS);
        Map<String, String> initParams = new HashMap<String,String>();
        initParams.put("contextConfigLocation", "file://" + springConfig);
        initParams.put("contextClass", NimbusXmlWebApplicationContext.class.getCanonicalName());
        context.setInitParams(initParams);
        context.addEventListener(new ContextLoaderListener());
        FilterHolder filterHolder = new FilterHolder(new DelegatingFilterProxy());
        filterHolder.setName("springSecurityFilterChain");
        context.addFilter(filterHolder, "/*", Handler.DEFAULT);
        final CXFServlet cxfServlet = new CXFServlet();
        ServletHolder servletHolder = new ServletHolder(cxfServlet);
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

        Context context = new Context(server, "/",  Context.NO_SESSIONS);
        Map<String, String> initParams = new HashMap<String,String>();
        initParams.put("contextConfigLocation", springConfig);
        initParams.put("contextClass", NimbusXmlWebApplicationContext.class.getCanonicalName());
        context.setInitParams(initParams);
        context.addEventListener(new ContextLoaderListener());
        FilterHolder filterHolder = new FilterHolder(new DelegatingFilterProxy());
        filterHolder.setName("filterChainProxy");
        context.addFilter(filterHolder, "/*", Handler.DEFAULT);
        ServletHolder servletHolder = new ServletHolder(new CXFServlet());
        servletHolder.setInitOrder(1);
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
        rootContext.register(AppRootConfig.class);

        // Manage the lifecycle of the root application context
        container.addListener(new ContextLoaderListener(rootContext));

        container.addFilter("resourceUrlEncodingFilter", ResourceUrlEncodingFilter.class).addMappingForUrlPatterns(
                EnumSet.allOf(DispatcherType.class), false, "/*");

        // Create the dispatcher servlet's Spring application context
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

  public void onStartup(ServletContext servletContext) throws ServletException {
    // Create the dispatcher servlet's Spring application context
    AnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext();
    dispatcherContext.register(WebConfiguration.class);

    servletContext.addListener(new ContextLoaderListener(dispatcherContext));


    ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(dispatcherContext));
    dispatcher.setLoadOnStartup(1);
    dispatcher.setAsyncSupported(true);
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

    dispatcher.addMapping("/");
  }

  private void registerListener(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = createContext(configurationClasses);
    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.addListener(new RequestContextListener());
  }
View Full Code Here

Examples of org.springframework.web.context.ContextLoaderListener

  }

  private void registerListener(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = createContext(InfrastructureContextConfiguration.class,
        TestDataContextConfiguration.class);
    servletContext.addListener(new ContextLoaderListener(rootContext));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.