diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 45e38d392f..b13cd79bc6 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -323,6 +323,8 @@ Trunk (Unreleased) HADOOP-10996. Stop violence in the *_HOME (aw) + HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java index f84ade0037..8aa777b993 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java @@ -44,6 +44,7 @@ import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; +import com.google.common.collect.ImmutableMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.HadoopIllegalArgumentException; @@ -415,6 +416,17 @@ private void addManagedListener(Connector connector) { private static WebAppContext createWebAppContext(String name, Configuration conf, AccessControlList adminsAcl, final String appDir) { WebAppContext ctx = new WebAppContext(); + ctx.setDefaultsDescriptor(null); + ServletHolder holder = new ServletHolder(new DefaultServlet()); + Map params = ImmutableMap. builder() + .put("acceptRanges", "true") + .put("dirAllowed", "false") + .put("gzip", "true") + .put("useFileMappedBuffer", "true") + .build(); + holder.setInitParameters(params); + ctx.setWelcomeFiles(new String[] {"index.html"}); + ctx.addServlet(holder, "/"); ctx.setDisplayName(name); ctx.setContextPath("/"); ctx.setWar(appDir + "/" + name);