Search in sources :

Example 56 with DefaultHandler

use of org.eclipse.jetty.server.handler.DefaultHandler in project cxf by apache.

the class BookServerServletFilter method run.

protected void run() {
    server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
    WebAppContext webappcontext = new WebAppContext();
    String contextPath = null;
    try {
        contextPath = getClass().getResource("/servlet_as_filter").toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setContextPath("/webapp");
    webappcontext.setWar(contextPath);
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
    server.setHandler(handlers);
    try {
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) URISyntaxException(java.net.URISyntaxException) URISyntaxException(java.net.URISyntaxException) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler)

Example 57 with DefaultHandler

use of org.eclipse.jetty.server.handler.DefaultHandler in project cxf by apache.

the class BookServerSpring method run.

protected void run() {
    server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
    WebAppContext webappcontext = new WebAppContext();
    String contextPath = null;
    try {
        contextPath = getClass().getResource("/jaxrs").toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setContextPath("/");
    webappcontext.setWar(contextPath);
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
    server.setHandler(handlers);
    try {
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) URISyntaxException(java.net.URISyntaxException) URISyntaxException(java.net.URISyntaxException) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler)

Example 58 with DefaultHandler

use of org.eclipse.jetty.server.handler.DefaultHandler in project cxf by apache.

the class AegisServer method run.

protected void run() {
    // System.out.println("Starting Server");
    server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
    WebAppContext webappcontext = new WebAppContext();
    String contextPath = null;
    try {
        contextPath = getClass().getResource("/webapp").toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setContextPath("/");
    webappcontext.setWar(contextPath);
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
    server.setHandler(handlers);
    try {
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) URISyntaxException(java.net.URISyntaxException) URISyntaxException(java.net.URISyntaxException) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler)

Example 59 with DefaultHandler

use of org.eclipse.jetty.server.handler.DefaultHandler in project cxf by apache.

the class AbstractSpringServer method run.

protected void run() {
    server = new org.eclipse.jetty.server.Server(port);
    WebAppContext webappcontext = new WebAppContext();
    webappcontext.setContextPath(contextPath);
    String warPath = null;
    try {
        warPath = getClass().getResource(resourcePath).toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setWar(warPath);
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
    server.setHandler(handlers);
    try {
        configureServer(server);
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) URISyntaxException(java.net.URISyntaxException) URISyntaxException(java.net.URISyntaxException) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler)

Example 60 with DefaultHandler

use of org.eclipse.jetty.server.handler.DefaultHandler in project cxf by apache.

the class AtomBookServer method run.

protected void run() {
    server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
    WebAppContext webappcontext = new WebAppContext();
    String contextPath = null;
    try {
        contextPath = getClass().getResource("/jaxrs_atom").toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setContextPath("/");
    webappcontext.setWar(contextPath);
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
    server.setHandler(handlers);
    try {
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) URISyntaxException(java.net.URISyntaxException) URISyntaxException(java.net.URISyntaxException) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler)

Aggregations

DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)63 HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)44 Server (org.eclipse.jetty.server.Server)29 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)26 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)19 URISyntaxException (java.net.URISyntaxException)18 ServerConnector (org.eclipse.jetty.server.ServerConnector)17 HandlerList (org.eclipse.jetty.server.handler.HandlerList)17 RequestLogHandler (org.eclipse.jetty.server.handler.RequestLogHandler)15 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)13 Handler (org.eclipse.jetty.server.Handler)10 QueuedThreadPool (org.eclipse.jetty.util.thread.QueuedThreadPool)10 ContextHandler (org.eclipse.jetty.server.handler.ContextHandler)8 ResourceHandler (org.eclipse.jetty.server.handler.ResourceHandler)8 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)8 Test (org.junit.Test)8 File (java.io.File)7 URI (java.net.URI)7 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)7 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)7