Package org.springframework.web.context.request

Examples of org.springframework.web.context.request.RequestContextListener


    root.getSessionHandler().getSessionManager().setMaxInactiveInterval(5000);

    Map<String, String> param = new HashMap<String, String>();
    param.put("contextConfigLocation", "classpath:context.xml");
    root.setInitParams(param);
    root.addEventListener(new RequestContextListener());
    root.addEventListener(new ContextLoaderListener());
    root.addServlet(org.apache.cxf.transport.servlet.CXFServlet.class, "/services/*");

    server.start();

 
View Full Code Here


        Context context = new Context(server, getBasePath(), Context.SESSIONS);
        Map<String, String> params = new HashMap<String, String>();
        params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
        context.setInitParams(params);
        context.addEventListener(new ContextLoaderListener());
        context.addEventListener(new RequestContextListener());
        context.addServlet(sh, getServletMapping());
        server.start();
        LOG.info("Jetty server running.");
        applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
  }
View Full Code Here

        Context context = new Context(server, getBasePath(), Context.SESSIONS);
        Map<String, String> params = new HashMap<String, String>();
        params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
        context.setInitParams(params);
        context.addEventListener(new ContextLoaderListener());
        context.addEventListener(new RequestContextListener());
        context.addServlet(sh, getServletMapping());
        server.start();
        LOG.info("Jetty server running.");
        this.applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
  }
View Full Code Here

        Context context = new Context(server, getBasePath(), Context.SESSIONS);
        Map<String, String> params = new HashMap<String, String>();
        params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
        context.setInitParams(params);
        context.addEventListener(new ContextLoaderListener());
        context.addEventListener(new RequestContextListener());
        context.addServlet(sh, getServletMapping());
        server.start();
        LOG.info("Jetty server running.");
        applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
    }
View Full Code Here

        Context context = new Context(server, getBasePath(), Context.SESSIONS);
        Map<String, String> params = new HashMap<String, String>();
        params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
        context.setInitParams(params);
        context.addEventListener(new ContextLoaderListener());
        context.addEventListener(new RequestContextListener());
        context.addServlet(sh, getServletMapping());
        server.start();
        LOG.info("Jetty server running.");
        this.applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
    }
View Full Code Here

        globals = new WebGlobals();
        subFactory.getAutowireCapableBeanFactory().autowireBeanProperties(globals,
                AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false);

        // listener
        listener = new RequestContextListener();
    }
View Full Code Here

  private void registerListeners(ServletContext servletContext,
      AnnotationConfigWebApplicationContext root) {

    servletContext.addListener(new LoggingInitializerListener());
    servletContext.addListener(new ContextLoaderListener(root));
    servletContext.addListener(new RequestContextListener());
  }
View Full Code Here

    }

    public static class SpringRequestContextListenerRegistryEntry implements ServletRequestListenerRegistryEntry {
        @Override
        public ServletRequestListener getListenerInstance() {
            return new RequestContextListener();
        }
View Full Code Here

      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(
//          "META-INF/applicationContext.xml");
View Full Code Here

        MutableResponse response = mock(MutableResponse.class, "response" + counter);

        RequestInfo request = new RequestInfo(context, null, httpRequest, response);
        VRaptorRequestHolder.setRequestForCurrentThread(request);

        RequestContextListener contextListener = new RequestContextListener();
        contextListener.requestInitialized(new ServletRequestEvent(context, httpRequest));
        result = execution.execute(request, counter);
        contextListener.requestDestroyed(new ServletRequestEvent(context, httpRequest));

        VRaptorRequestHolder.resetRequestForCurrentThread();
        return result;
      }
    };
View Full Code Here

TOP

Related Classes of org.springframework.web.context.request.RequestContextListener

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.