Search in sources :

Example 81 with HandlerCollection

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

the class BookServerProxySpring 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_proxy").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 82 with HandlerCollection

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

the class BookServerResourceCreatedSpringProviders 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_spring_providers").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 83 with HandlerCollection

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

the class BookServerRestSoap 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_soap_rest").toURI().getPath();
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    webappcontext.setContextPath("/test");
    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 84 with HandlerCollection

use of org.eclipse.jetty.server.handler.HandlerCollection 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 85 with HandlerCollection

use of org.eclipse.jetty.server.handler.HandlerCollection 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)

Aggregations

HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)115 DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)57 Server (org.eclipse.jetty.server.Server)50 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)40 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)39 ServerConnector (org.eclipse.jetty.server.ServerConnector)34 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)31 RequestLogHandler (org.eclipse.jetty.server.handler.RequestLogHandler)30 Handler (org.eclipse.jetty.server.Handler)26 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)18 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)17 ContextHandler (org.eclipse.jetty.server.handler.ContextHandler)17 URISyntaxException (java.net.URISyntaxException)16 QueuedThreadPool (org.eclipse.jetty.util.thread.QueuedThreadPool)16 URI (java.net.URI)14 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)13 File (java.io.File)12 IOException (java.io.IOException)11 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)11 Slf4jRequestLog (org.eclipse.jetty.server.Slf4jRequestLog)10