From 2da10944f44d00e0ac635015d7ac400cde0432ba Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Fri, 18 Nov 2016 13:50:05 +1100 Subject: [PATCH] Issue #1092 --- .../java/org/eclipse/jetty/runner/Runner.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java b/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java index bd2aadb4aa1..b3372f94095 100644 --- a/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java +++ b/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java @@ -50,11 +50,13 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.StatisticsServlet; import org.eclipse.jetty.util.RolloverFileOutputStream; +import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.webapp.WebAppContext; +import org.eclipse.jetty.webapp.WebInfConfiguration; import org.eclipse.jetty.xml.XmlConfiguration; /** @@ -430,14 +432,25 @@ public class Runner if (contextPathSet) handler.setContextPath(contextPath); _contexts.addHandler(handler); - handler.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", __containerIncludeJarPattern); + String containerIncludeJarPattern = (String)handler.getAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN); + if (containerIncludeJarPattern == null) + containerIncludeJarPattern = __containerIncludeJarPattern; + else + { + if (!containerIncludeJarPattern.contains(__containerIncludeJarPattern)) + { + containerIncludeJarPattern = containerIncludeJarPattern+(StringUtil.isBlank(containerIncludeJarPattern)?"":"|")+ __containerIncludeJarPattern; + } + } + + handler.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, containerIncludeJarPattern); } else { // assume it is a WAR file WebAppContext webapp = new WebAppContext(_contexts, ctx.toString(), contextPath); webapp.setConfigurationClasses(__plusConfigurationClasses); - webapp.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", + webapp.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, __containerIncludeJarPattern); } } @@ -477,6 +490,8 @@ public class Runner _logHandler.setRequestLog(requestLog); } } + + protected void prependHandler (Handler handler, HandlerCollection handlers) {