diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index a97a6b9ac06..b0f5038eb1a 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -14,6 +14,8 @@ Release 2.7.0 - UNRELEASED HADOOP-11172. Improve error message in Shell#runCommand on OutOfMemoryError. (Yongjun Zhang via wang) + HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9) + OPTIMIZATIONS BUG FIXES 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 3741fabfa9c..1bdb256517f 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.HttpServletRequest; 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 @@ public final class HttpServer2 implements FilterContainer { 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);