Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.WebApplicationContext


     * @return the configured web application
     * @throws IOException
     */
    public WebApplicationContext addWebApp( String context, String path ) throws IOException
    {
        WebApplicationContext webapp = server.addWebApplication( context, path );
        log.info( "Adding test webapp " + context + " for path " + path );

        // Add a security handler for any constraints enabled by web.xml
        SecurityHandler sh = new SecurityHandler();
        webapp.addHandler( sh );

        return webapp;
    }
View Full Code Here


              server.stop();
        }
        monitor.subTask(WYSIWYGPlugin.getResourceString("editor.subtask.start_server"));
        if (!isWebServerStarted()) {
            server = new Server();
            WebApplicationContext applicationContext = new WebApplicationContext(fckRootFolder.getAbsolutePath());
            applicationContext.setContextPath("/");
            applicationContext.addHandler(new ResourceHandler());
            server.addContext(applicationContext);
            InetAddrPort address = new InetAddrPort(SERVER_PORT);
            server.addListener(address);
            server.start();
        }
View Full Code Here

            server.addListener(socketListener);

            NCSARequestLog log = new NCSARequestLog();
            server.setRequestLog(log);

            WebApplicationContext context = server.addWebApplication(_contextPath, _warPath);

            context.setDefaultsDescriptor("src/test/conf/webdefault.xml");

            server.start();

            return server;
        }
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

            }

            NCSARequestLog log = new NCSARequestLog();
            server.setRequestLog(log);

            WebApplicationContext context = server.addWebApplication(contextPath, webappPath);

            for (String virtualHost : virtualHosts)
            {
                context.addVirtualHost(virtualHost);
            }

            context.setDefaultsDescriptor(webDefaults);

            server.start();

            return server;
        }
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

    return s;
  }

  private static class Server extends org.mortbay.jetty.Server implements JettyShims.Server {
    public void addWar(String war, String contextPath) {
      WebApplicationContext wac = new WebApplicationContext();
      wac.setContextPath(contextPath);
      wac.setWAR(war);
      addContext(wac);
    }
View Full Code Here

    return s;
  }

  private static class Server extends org.mortbay.jetty.Server implements JettyShims.Server {
    public void addWar(String war, String contextPath) {
      WebApplicationContext wac = new WebApplicationContext();
      wac.setContextPath(contextPath);
      wac.setWAR(war);
      addContext(wac);
    }
View Full Code Here

    return s;
  }

  private static class Server extends org.mortbay.jetty.Server implements JettyShims.Server {
    public void addWar(String war, String contextPath) {
      WebApplicationContext wac = new WebApplicationContext();
      wac.setContextPath(contextPath);
      wac.setWAR(war);
      addContext(wac);
    }
View Full Code Here

            }

            NCSARequestLog log = new NCSARequestLog();
            server.setRequestLog(log);

            WebApplicationContext context = server.addWebApplication(contextPath, webappPath);

            context.setDefaultsDescriptor(webDefaults);

            server.start();

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