Package org.eclipse.jetty.server.handler

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection.addContext()


  public Handler createHandler() throws IOException  {
    ContextHandlerCollection contexts = new ContextHandlerCollection();

    for (Context context : this.configuration.getContexts()) {
      String contextRoot = StringUtils.prependIfMissing(context.getContextRoot(),"/");
      ContextHandler handler = contexts.addContext(contextRoot, "");
      handler.setAliases(true);
      handler.setHandler(this.createResourceHandler(true, context.getDirectory().getCanonicalPath(), null));
    }

    ContextHandler rootContextHandler = contexts.addContext("/", "");
View Full Code Here


      ContextHandler handler = contexts.addContext(contextRoot, "");
      handler.setAliases(true);
      handler.setHandler(this.createResourceHandler(true, context.getDirectory().getCanonicalPath(), null));
    }

    ContextHandler rootContextHandler = contexts.addContext("/", "");
    rootContextHandler.setHandler(this.createResourceHandler(false, this.configuration.getBasedir().getCanonicalPath(), new String[]{this.getWelcomeFilePath()}));
    rootContextHandler.setAliases(true);

    ContextHandler classPathContextHandler = contexts.addContext("/classpath", "");
    classPathContextHandler.setHandler(new ClassPathResourceHandler(configuration.getProjectClassLoader()));
View Full Code Here

    ContextHandler rootContextHandler = contexts.addContext("/", "");
    rootContextHandler.setHandler(this.createResourceHandler(false, this.configuration.getBasedir().getCanonicalPath(), new String[]{this.getWelcomeFilePath()}));
    rootContextHandler.setAliases(true);

    ContextHandler classPathContextHandler = contexts.addContext("/classpath", "");
    classPathContextHandler.setHandler(new ClassPathResourceHandler(configuration.getProjectClassLoader()));
    classPathContextHandler.setAliases(true);

    ContextHandler webJarsContextHandler = contexts.addContext("/webjars", "");
    webJarsContextHandler.setHandler(new WebJarResourceHandler(configuration.getProjectClassLoader()));
View Full Code Here

    ContextHandler classPathContextHandler = contexts.addContext("/classpath", "");
    classPathContextHandler.setHandler(new ClassPathResourceHandler(configuration.getProjectClassLoader()));
    classPathContextHandler.setAliases(true);

    ContextHandler webJarsContextHandler = contexts.addContext("/webjars", "");
    webJarsContextHandler.setHandler(new WebJarResourceHandler(configuration.getProjectClassLoader()));
    webJarsContextHandler.setAliases(true);

    return contexts;
  }
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.