Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x

This commit is contained in:
Jan Bartel 2016-11-18 13:51:16 +11:00
commit 98ad4e1610
1 changed files with 17 additions and 2 deletions

View File

@ -50,11 +50,13 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlet.StatisticsServlet; import org.eclipse.jetty.servlet.StatisticsServlet;
import org.eclipse.jetty.util.RolloverFileOutputStream; 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.Log;
import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Constraint;
import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.webapp.WebInfConfiguration;
import org.eclipse.jetty.xml.XmlConfiguration; import org.eclipse.jetty.xml.XmlConfiguration;
/** /**
@ -430,14 +432,25 @@ public class Runner
if (contextPathSet) if (contextPathSet)
handler.setContextPath(contextPath); handler.setContextPath(contextPath);
_contexts.addHandler(handler); _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 else
{ {
// assume it is a WAR file // assume it is a WAR file
WebAppContext webapp = new WebAppContext(_contexts, ctx.toString(), contextPath); WebAppContext webapp = new WebAppContext(_contexts, ctx.toString(), contextPath);
webapp.setConfigurationClasses(__plusConfigurationClasses); webapp.setConfigurationClasses(__plusConfigurationClasses);
webapp.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", webapp.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN,
__containerIncludeJarPattern); __containerIncludeJarPattern);
} }
} }
@ -477,6 +490,8 @@ public class Runner
_logHandler.setRequestLog(requestLog); _logHandler.setRequestLog(requestLog);
} }
} }
protected void prependHandler (Handler handler, HandlerCollection handlers) protected void prependHandler (Handler handler, HandlerCollection handlers)
{ {