Package org.apache.naming.resources

Examples of org.apache.naming.resources.VirtualDirContext


        ctx.setLoader(loader);

        String extraMappings = "/=test/webapp-3.0-virtual-webapp/src/main/webapp2" + //
            ",/other=test/webapp-3.0-virtual-webapp/src/main/misc" + //
            ",/WEB-INF/classes=test/webapp-3.0-virtual-webapp/target/classes";
        VirtualDirContext resources = new VirtualDirContext();
        resources.setExtraResourcePaths(extraMappings);
        ctx.setResources(resources);

        StandardJarScanner jarScanner = new StandardJarScanner();
        jarScanner.setScanAllDirectories(true);
        ctx.setJarScanner(jarScanner);
View Full Code Here


        tomcat.stop();

        // then test that if we configure StandardContext with the additional
        // path, the servlet is detected
        // ctx.setAdditionalVirtualWebInfClasses(additionWebInfClasses.getAbsolutePath());
        VirtualDirContext resources = new VirtualDirContext();
        resources.setExtraResourcePaths("/WEB-INF/classes=" + additionWebInfClasses);
        ctx.setResources(resources);

        tomcat.start();
        assertPageContains("/test/annotatedServlet", MyAnnotatedServlet.MESSAGE);
        tomcat.stop();
View Full Code Here

    public static void main(String[] args) throws Exception {
  Tomcat tomcat = new Tomcat();
  tomcat.setPort(8080);

  StandardContext ctx = (StandardContext) tomcat.addWebapp("/", new File("src/main/webapp").getAbsolutePath());
  VirtualDirContext resources = new VirtualDirContext();
  resources.setExtraResourcePaths("/WEB-INF/classes=" + new File("build/classes/main").getAbsolutePath());
  ctx.setResources(resources);

  tomcat.start();
  tomcat.getServer().await();
    }
View Full Code Here

  public static void main(String[] args) throws Exception {
    Tomcat tomcat = new Tomcat();
    tomcat.setPort(8080);

    StandardContext ctx = (StandardContext) tomcat.addWebapp("/", new File("src/main/webapp").getAbsolutePath());
    VirtualDirContext resources = new VirtualDirContext();
    resources.setExtraResourcePaths("/WEB-INF/classes=" + new File("build/classes/main").getAbsolutePath());
        ctx.setResources(resources);

    tomcat.start();
    tomcat.getServer().await();
  }
View Full Code Here

  public static void main(String[] args) throws Exception {
    Tomcat tomcat = new Tomcat();
    tomcat.setPort(8080);

    StandardContext ctx = (StandardContext) tomcat.addWebapp("/", new File("src/main/webapp").getAbsolutePath());
    VirtualDirContext resources = new VirtualDirContext();
    resources.setExtraResourcePaths("/WEB-INF/classes=" + new File("build/classes/main").getAbsolutePath());
    ctx.setResources(resources);

    tomcat.start();
    tomcat.getServer().await();
  }
View Full Code Here

        ctx.setLoader(loader);

        String extraMappings = "/=test/webapp-3.0-virtual-webapp/src/main/webapp2" + //
            ",/other=test/webapp-3.0-virtual-webapp/src/main/misc" + //
            ",/WEB-INF/classes=test/webapp-3.0-virtual-webapp/target/classes";
        VirtualDirContext resources = new VirtualDirContext();
        resources.setExtraResourcePaths(extraMappings);
        ctx.setResources(resources);

        StandardJarScanner jarScanner = new StandardJarScanner();
        jarScanner.setScanAllDirectories(true);
        ctx.setJarScanner(jarScanner);
View Full Code Here

        tomcat.stop();

        // then test that if we configure StandardContext with the additional
        // path, the servlet is detected
        // ctx.setAdditionalVirtualWebInfClasses(additionWebInfClasses.getAbsolutePath());
        VirtualDirContext resources = new VirtualDirContext();
        resources.setExtraResourcePaths("/WEB-INF/classes=" + additionWebInfClasses);
        ctx.setResources(resources);

        tomcat.start();
        assertPageContains("/test/annotatedServlet", MyAnnotatedServlet.MESSAGE);
        tomcat.stop();
View Full Code Here

TOP

Related Classes of org.apache.naming.resources.VirtualDirContext

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.