Package org.springframework.web.context

Examples of org.springframework.web.context.ContextLoaderListener


    rootContext.register(RootConfig.class);
   
    FilterRegistration.Dynamic securityFilter = servletContext.addFilter("securityFilter", new DelegatingFilterProxy("springSecurityFilterChain"));
    securityFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
   
    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.setInitParameter("defaultHtmlEscape", "true");
   
    AnnotationConfigWebApplicationContext mvcContext = new AnnotationConfigWebApplicationContext();
    mvcContext.register(WebMvcConfig.class);

View Full Code Here


    @Test
    public void testXMLSpringConfigurationWithWebSocket() throws Exception
    {
        prepareServer(0, null, false);
        // Add Spring listener
        context.addEventListener(new ContextLoaderListener());
        String config = WEBSOCKET_JSR_356.equals(wsTransportType) ?
                "applicationContext-javax-websocket.xml" : "applicationContext-jetty-websocket.xml";
        context.getInitParams().put(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:/" + config);
        startServer();
View Full Code Here

    public void testSpringWiringOfOort() throws Exception
    {
        Server server = new Server();
        ServletContextHandler context = new ServletContextHandler(server, "/");
        WebSocketServerContainerInitializer.configureContext(context);
        context.addEventListener(new ContextLoaderListener());
        context.getInitParams().put(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:/applicationContext.xml");
        server.start();

        ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
View Full Code Here

    public void testXMLSpringConfiguration() throws Exception
    {
        int port = this.port;
        server.stop();
        // Add Spring listener
        context.addEventListener(new ContextLoaderListener());
        context.getInitParams().put(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:/applicationContext.xml");
        connector.setPort(port);
        server.start();

        WebApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(context.getServletContext());
View Full Code Here

  private WebApplicationContext createRootContext(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.register(CoreConfig.class);
    rootContext.refresh();

    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.setInitParameter("defaultHtmlEscape", "true");

    return rootContext;
  }
View Full Code Here

  private WebApplicationContext createRootContext(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.register(CoreConfig.class);
    rootContext.refresh();

    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.setInitParameter("defaultHtmlEscape", "true");

    return rootContext;
  }
View Full Code Here

  private WebApplicationContext createRootContext(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.register(CoreConfig.class, SecurityConfig.class);
    rootContext.refresh();

    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.setInitParameter("defaultHtmlEscape", "true");

    return rootContext;
  }
View Full Code Here

  private WebApplicationContext createRootContext(ServletContext servletContext) {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.register(CoreConfig.class, SecurityConfig.class);
    rootContext.refresh();

    servletContext.addListener(new ContextLoaderListener(rootContext));
    servletContext.setInitParameter("defaultHtmlEscape", "true");

    return rootContext;
  }
View Full Code Here

            throws ServletException {
        beforeSessionRepositoryFilter(servletContext);
        if(configurationClasses != null) {
            AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext();
            rootAppContext.register(configurationClasses);
            servletContext.addListener(new ContextLoaderListener(rootAppContext));
        }
        insertSessionRepositoryFilter(servletContext);
        afterSessionRepositoryFilter(servletContext);
    }
View Full Code Here

  private ContextLoaderListener contextLoaderListener;

  private static final String PLUTO_SERVICE_CONFIG_LOCATION = "classpath:pluto-portal-driver-services-config.xml";

  public OverrideContextLoaderListener() {
    this.contextLoaderListener = new ContextLoaderListener();
  }
View Full Code Here

TOP

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

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.