Examples of GenericWebApplicationContext


Examples of org.springframework.web.context.support.GenericWebApplicationContext

            }
        };
    }

    public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
        GenericWebApplicationContext context = new GenericWebApplicationContext();
        context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
        prepareContext(context);
        loadBeanDefinitions(context, mergedConfig);
        return context;
    }
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

    @Override
    public ApplicationContext loadContext(final String... locations) throws Exception {
        this.locations = locations;

        this.servletContext = new MockServletContext(this.contextPath, new FileSystemResourceLoader());
        this.webContext = new GenericWebApplicationContext();

        this.servletContext.setAttribute(ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.webContext);
        this.webContext.setServletContext(this.servletContext);

        new XmlBeanDefinitionReader(this.webContext).loadBeanDefinitions(locations);
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

      root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class));

      //Changing session cookie name to avoid conflicts
      root.getSessionHandler().getSessionManager().setSessionCookie("AMBARISESSIONID");

      GenericWebApplicationContext springWebAppContext = new GenericWebApplicationContext();
      springWebAppContext.setServletContext(root.getServletContext());
      springWebAppContext.setParent(springAppContext);
      /* Configure web app context */
      root.setResourceBase(configs.getWebAppDir());

      root.getServletContext().setAttribute(
          WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

          ServletContextHandler.SECURITY | ServletContextHandler.SESSIONS);

      //Changing session cookie name to avoid conflicts
      root.getSessionHandler().getSessionManager().setSessionCookie("AMBARISESSIONID");

      GenericWebApplicationContext springWebAppContext = new GenericWebApplicationContext();
      springWebAppContext.setServletContext(root.getServletContext());
      springWebAppContext.setParent(springAppContext);
      /* Configure web app context */
      root.setResourceBase(configs.getWebAppDir());

      root.getServletContext().setAttribute(
          WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

        // set the context path
        this.servletServiceContext.setContextPath(this.contextPath);

        // 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

Examples of org.springframework.web.context.support.GenericWebApplicationContext

    @Override
    protected GenericApplicationContext createApplicationContext(String[] locations) {
        try {
            ServletContext ctx = createServletContext();

            GenericWebApplicationContext context = new GenericWebApplicationContext(
                    new UnoverridingBeanFactory());
            context.setServletContext(ctx);
            prepareApplicationContext(context);
            customizeBeanFactory(context.getDefaultListableBeanFactory());
            createBeanDefinitionReader(context).loadBeanDefinitions(locations);
            context.refresh();
            return context;
        } catch (Exception orig) {
            for (Throwable loop = orig; loop != null; loop = loop.getCause()) {
                if (loop instanceof SQLException) {
                    LOGGER.warning("Found a SQLException. Unrolling stacktrace.");
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

   
      System.setProperty("org.geotools.referencing.forceXY", "true");
    File testdata=TestData.file(this, ".");
    System.setProperty("GEOSERVER_DATA_DIR", testdata.getAbsolutePath());
    GeoServerResourceLoader loader = new GeoServerResourceLoader(testdata);   
        GenericWebApplicationContext context = new GenericWebApplicationContext();
        context.getBeanFactory().registerSingleton("resourceLoader", loader);
        GeoserverDataDirectory.init(context);
   
        // initialized WGS84 CRS (used by many tests)
        WGS84=CRS.decode("EPSG:4326");
       
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

          ServletContextHandler.SECURITY | ServletContextHandler.SESSIONS);

      //Changing session cookie name to avoid conflicts
      root.getSessionHandler().getSessionManager().setSessionCookie("AMBARISESSIONID");

      GenericWebApplicationContext springWebAppContext = new GenericWebApplicationContext();
      springWebAppContext.setServletContext(root.getServletContext());
      springWebAppContext.setParent(springAppContext);
      /* Configure web app context */
      root.setResourceBase(configs.getWebAppDir());

      root.getServletContext().setAttribute(
          WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

  private GenericApplicationContext createFlowApplicationContext(Resource[] resources) {
    ApplicationContext parent = getContext().getApplicationContext();
    GenericApplicationContext flowContext;
    if (parent instanceof WebApplicationContext) {
      GenericWebApplicationContext webContext = new GenericWebApplicationContext();
      webContext.setServletContext(((WebApplicationContext) parent).getServletContext());
      flowContext = webContext;
    } else {
      flowContext = new GenericApplicationContext();
    }
    flowContext.setDisplayName("Flow ApplicationContext [" + getContext().getFlowId() + "]");
View Full Code Here

Examples of org.springframework.web.context.support.GenericWebApplicationContext

          ServletContextHandler.SECURITY | ServletContextHandler.SESSIONS);

      //Changing session cookie name to avoid conflicts
      root.getSessionHandler().getSessionManager().setSessionCookie("AMBARISESSIONID");

      GenericWebApplicationContext springWebAppContext = new GenericWebApplicationContext();
      springWebAppContext.setServletContext(root.getServletContext());
      springWebAppContext.setParent(springAppContext);
      /* Configure web app context */
      root.setResourceBase(configs.getWebAppDir());

      root.getServletContext().setAttribute(
          WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
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.