Package org.springframework.web.context.support

Examples of org.springframework.web.context.support.GenericWebApplicationContext.refresh()


    DispatcherServlet servlet = new DispatcherServlet() {
      protected WebApplicationContext createWebApplicationContext(WebApplicationContext parent) {
        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyFormController.class));
        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here


    DispatcherServlet servlet = new DispatcherServlet() {
      protected WebApplicationContext createWebApplicationContext(WebApplicationContext parent) {
        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyModelFormController.class));
        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class));
        DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator();
        autoProxyCreator.setBeanFactory(wac.getBeanFactory());
        wac.getBeanFactory().addBeanPostProcessor(autoProxyCreator);
        wac.getBeanFactory().registerSingleton("advisor", new DefaultPointcutAdvisor(new SimpleTraceInterceptor()));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyCommandProvidingFormController.class));
        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class));
        RootBeanDefinition adapterDef = new RootBeanDefinition(AnnotationMethodHandlerAdapter.class);
        adapterDef.getPropertyValues().addPropertyValue("webBindingInitializer", new MyWebBindingInitializer());
        wac.registerBeanDefinition("handlerAdapter", adapterDef);
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

        // create servlet-service specific Spring web application context
        GenericWebApplicationContext container = new GenericWebApplicationContext();
        container.setParent(this.parentContainer);
        container.setServletContext(this.servletServiceContext);
        container.refresh();
        this.servletServiceContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, container);

        // create a servlet config based on the block servlet context
        ServletConfig blockServletConfig =
                new ServletConfig() {
View Full Code Here

        BeanDefinitionBuilder.genericBeanDefinition(HttpInvokerServiceExporter.class).
        addPropertyValue("service", copperMonitoringService).
        addPropertyValue("serviceInterface", CopperMonitoringService.class.getName()).
        addPropertyValue("remoteInvocationExecutor", remoteInvocationExecutor).
        getBeanDefinition());
    genericWebApplicationContext.refresh();
   
    DispatcherServlet dispatcherServlet = new DispatcherServlet(genericWebApplicationContext);
    ServletHolder servletHolder = new ServletHolder(dispatcherServlet);
    servletContextHandler.addServlet(servletHolder, "/*");
   
 
View Full Code Here

                    XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(mvcContext);
                    xmlReader.setBeanClassLoader(module.getClassLoader());
                    xmlReader.loadBeanDefinitions(new ClassPathResource(springMvcApplicationContextLocation,
                            module.getClassLoader()));
                    mvcContext.setParent(existingLilyRuntimeSpringContext);
                    mvcContext.refresh();

                    DispatcherServlet dispatcherServlet = new DispatcherServlet(mvcContext);
                    dispatcherServlet.setDetectAllHandlerMappings(true);
                    return dispatcherServlet;
                } finally {
View Full Code Here

                    XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(mvcContext);
                    xmlReader.setBeanClassLoader(module.getClassLoader());
                    xmlReader.loadBeanDefinitions(new ClassPathResource(springMvcApplicationContextLocation,
                            module.getClassLoader()));
                    mvcContext.setParent(existingLilyRuntimeSpringContext);
                    mvcContext.refresh();

                    return new JerseySpringServlet(mvcContext);
                } finally {
                    Thread.currentThread().setContextClassLoader(orig);
                }
View Full Code Here

    private void configureWebContext() {
        ServletContext servletContext = getServletContext();
        GenericWebApplicationContext webContext = new GenericWebApplicationContext();
        webContext.setServletContext(servletContext);
        webContext.setParent(context);
        webContext.refresh();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, webContext);
        if (webContext != null) {
            endpoint = webContext.getBean(SoapServerConstants.ENDPOINT_BEAN_NAME, GenericContextDomEndpoint.class);
        }
    }
View Full Code Here

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
  }


   public static interface IScopedTestBean {
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.