ARTEMIS-909 - fix welcome files for root address with Jetty

https://issues.apache.org/jira/browse/ARTEMIS-909
This commit is contained in:
Andy Taylor 2017-01-03 14:16:49 +00:00 committed by Justin Bertram
parent 973265b1ef
commit 58d47897c3
1 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
@ -111,7 +112,12 @@ public class WebServerComponent implements ExternalComponent {
DefaultHandler defaultHandler = new DefaultHandler();
defaultHandler.setServeIcon(false);
handlers.addHandler(resourceHandler);
ContextHandler context = new ContextHandler();
context.setContextPath("/");
context.setResourceBase(warDir.toString());
context.setHandler(resourceHandler);
handlers.addHandler(context);
handlers.addHandler(defaultHandler);
server.setHandler(handlers);
}