activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-909 - fix welcome files for root address with Jetty
Date Thu, 05 Jan 2017 15:42:13 GMT
ARTEMIS-909 - fix welcome files for root address with Jetty

https://issues.apache.org/jira/browse/ARTEMIS-909


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/58d47897
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/58d47897
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/58d47897

Branch: refs/heads/master
Commit: 58d47897c3a39f95fb10a2cb4dd636668e53896c
Parents: 973265b
Author: Andy Taylor <andy.tayls67@gmail.com>
Authored: Tue Jan 3 14:16:49 2017 +0000
Committer: Justin Bertram <jbertram@apache.org>
Committed: Thu Jan 5 09:07:30 2017 -0600

----------------------------------------------------------------------
 .../activemq/artemis/component/WebServerComponent.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/58d47897/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
----------------------------------------------------------------------
diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
index a34d179..e24215c 100644
--- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
+++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
@@ -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);
    }


Mime
View raw message