Search in sources :

Example 1 with HostResourceHandler

use of io.leopard.jetty.handler.HostResourceHandler in project leopard by tanhaichao.

the class ResourcesManager method addResource.

public static void addResource(String host, String resourceBase) {
    HostResourceHandler handler = new HostResourceHandler(host, resourceBase);
    handlerList.add(handler);
}
Also used : HostResourceHandler(io.leopard.jetty.handler.HostResourceHandler)

Example 2 with HostResourceHandler

use of io.leopard.jetty.handler.HostResourceHandler in project leopard by tanhaichao.

the class WebappDaoImpl method getHandlerList.

protected Handler getHandlerList(List<String> hostList) {
    // jettyServer.getWebappService().addHandler(new HostResourceHandler("ftrade.leopard.io", "/data/src/ftrade_html/"));
    if (hostList.contains("fshop.leopard.io")) {
        if (false) {
            return new HostResourceHandler("fshop.leopard.io", "/data/src/fshop_html/");
        }
        HandlerList handlerList = new HandlerList();
        handlerList.addHandler(new HostResourceHandler("fshop.leopard.io", "/data/src/fshop_html/"));
        handlerList.addHandler(new HostResourceHandler("ftrade.leopard.io", "/data/src/ftrade_html/"));
        try {
            handlerList.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return handlerList;
    }
    return null;
}
Also used : HandlerList(org.eclipse.jetty.server.handler.HandlerList) HostResourceHandler(io.leopard.jetty.handler.HostResourceHandler) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Aggregations

HostResourceHandler (io.leopard.jetty.handler.HostResourceHandler)2 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 HandlerList (org.eclipse.jetty.server.handler.HandlerList)1