Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.WebApplicationContext


            if (properties.getProperty("xmppServer.defaultSecretKey") != null) {
                manager.setDefaultSecretKey(properties.getProperty("xmppServer.defaultSecretKey"));
            }

            // Add web-app
            WebApplicationContext webAppContext = jetty.addWebApplication("/",
                    homeDir + File.separator + "webapp");
            webAppContext.setWelcomeFiles(new String[]{"index.jsp"});

            // Start the http server
            jetty.start();

            if (!plainStarted && !secureStarted) {
View Full Code Here


   * @param servletClass The servlet class
   */
  public <T extends HttpServlet>
                    void addServlet(String name, String pathSpec,
                                    Class<T> servletClass) {
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

   */
  public <T extends HttpServlet>
   void addServlet(String name, String pathSpec,
                   Class<T> servletClass) {
  
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

      listener.setPort(port);
      listener.setHost(listen);
     
      webServer.addListener(listener);
     
      WebApplicationContext wac = new WebApplicationContext();
      wac.setContextPath("/hwi");
 
      String hwiWAR = conf.getVar(HiveConf.ConfVars.HIVEHWIWARFILE);
      if (! new File (hwiWAR).exists() ){
        l4j.fatal("HWI WAR file not found at "+ hwiWAR );
      }
     
      wac.setWAR(hwiWAR);
     
      /*The command line args may be used by multiple components. Rather by setting
       * these as a system property we avoid having to specifically pass them
       */
      StringBuffer sb = new StringBuffer();
View Full Code Here

   */
  public <T extends HttpServlet>
   void addServlet(String name, String pathSpec,
                   Class<T> servletClass) {
  
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

   * @param pathSpec The path spec for the servlet
   * @param servletClass The servlet class
   */
  public <T extends HttpServlet> void addServlet(String name, String pathSpec,
      Class<T> servletClass) {
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

   * @param pathSpec The path spec for the servlet
   * @param servletClass The servlet class
   */
  public <T extends HttpServlet> void addServlet(String name, String pathSpec,
      Class<T> servletClass) {
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

   */
  public <T extends HttpServlet>
   void addServlet(String name, String pathSpec,
                   Class<T> servletClass) {
  
    WebApplicationContext context = webAppContext;
    try {
      if (name == null) {
        context.addServlet(pathSpec, servletClass.getName());
      } else {
        context.addServlet(name, pathSpec, servletClass.getName());
      }
    } catch (ClassNotFoundException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
    } catch (InstantiationException ex) {
      throw makeRuntimeException("Problem instantiating class", ex);
View Full Code Here

    listener.setMaxThreads(numThreads);
    webServer.addListener(listener);
    NCSARequestLog ncsa = new NCSARequestLog();
    ncsa.setLogLatency(true);
    webServer.setRequestLog(ncsa);
    WebApplicationContext context =
      webServer.addWebApplication("/api", InfoServer.getWebAppDir("rest"));
    context.addServlet("stacks", "/stacks",
      StatusHttpServer.StackServlet.class.getName());
    context.addServlet("logLevel", "/logLevel",
      org.apache.hadoop.log.LogLevel.Servlet.class.getName());
    webServer.start();
  }
View Full Code Here

    listener.setMaxThreads(numThreads);
    webServer.addListener(listener);
    NCSARequestLog ncsa = new NCSARequestLog();
    ncsa.setLogLatency(true);
    webServer.setRequestLog(ncsa);
    WebApplicationContext context =
      webServer.addWebApplication("/api", InfoServer.getWebAppDir("rest"));
    context.addServlet("stacks", "/stacks",
      StatusHttpServer.StackServlet.class.getName());
    context.addServlet("logLevel", "/logLevel",
      org.apache.hadoop.log.LogLevel.Servlet.class.getName());
    webServer.start();
  }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.servlet.WebApplicationContext

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.