Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.Server$DateField


  private JettyRunner() {
    // hide constructor
  }

  public static void main(String[] args) throws Exception {
    Server server = startServer();
    server.join();
  }
View Full Code Here


    Server server = startServer();
    server.join();
  }

  public static Server startServer() throws Exception {
    Server server = new Server();

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8888);
    server.addConnector(connector);

    WebAppContext webApp = new WebAppContext();
    webApp.setContextPath("/");
    webApp.setWar("src/main/webapp");
    server.setHandler(webApp);
    server.start();
    return server;
  }
View Full Code Here

import org.junit.Test;

public class JettyRunnerTest {
  @Test
  public void testStartStop() throws Exception {
    Server server = JettyRunner.startServer();
    server.stop();
  }
View Full Code Here

    this.contextPath = contextPath;
  }


  public void start() throws Exception {
    jettyServer = new Server(0);
   
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath(contextPath);
    jettyServer.setHandler(context);
  
View Full Code Here

public class Jetty7JerseyTest extends BasePubSubTest {
    protected Server server;

    @Override
    public void startServer() throws Exception {
        server = new Server(port);
        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        server.setHandler(context);
        context.addServlet(new ServletHolder(atmoServlet), "/*");
        server.start();
View Full Code Here

import org.eclipse.jetty.webapp.WebAppContext;

public class Start {

    public static void main(String[] args) throws Exception {
        Server server = new Server();
        SelectChannelConnector connector = new SelectChannelConnector();

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(1000 * 60 * 60);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.setConnectors(new Connector[]{connector});

        WebAppContext webapp = new WebAppContext("src/main/webapp", "/");
        HandlerCollection contexts = new ContextHandlerCollection();
        contexts.addHandler(webapp);
        contexts.addHandler(new DefaultHandler());
        server.setHandler(contexts);

        try {
            System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
            server.start();
            System.in.read();
            System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
            // while (System.in.available() == 0) {
            //   Thread.sleep(5000);
            // }
            server.stop();
            server.join();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(100);
        }
    }
View Full Code Here

    public void startServer() throws Exception {

        int port = TestHelper.getEnvVariable("ATMOSPHERE_HTTP_PORT", findFreePort());
        urlTarget = "http://127.0.0.1:" + port + "/invoke";

        server = new Server(port);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        server.setHandler(context);
View Full Code Here

   
    try {
      URL url = getClass().getClassLoader().getResource("org/nutz/mvc/testapp/Root/FLAG");
      String path = url.toExternalForm();
      System.err.println(url);
      server = new Server(8888);
      String warUrlString = path.substring(0,path.length() - 4);
      server.setHandler(new WebAppContext(warUrlString, getContextPath()));
      server.start();
    } catch (Throwable e) {
      if(server != null)
View Full Code Here

 
  protected Server server;
 
  public ManifoldCFJettyRunner( int port, String crawlerWarPath, String authorityServiceWarPath, String apiWarPath, boolean useParentLoader )
  {
    server = new Server( port );   
    server.setStopAtShutdown( true );
   
    // Initialize the servlets
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    server.setHandler(contexts);
View Full Code Here

       
        SecurityHandler securityHandler = null;
        if (server == null) {
            DefaultHandler defaultHandler = null;
            // create a new jetty server instance if there is no server there           
            server = new Server();
           
            server.setSendServerVersion(getSendServerVersion());
           
            if (mBeanContainer != null) {
                server.getContainer().addEventListener(mBeanContainer);
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.Server$DateField

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.