HADOOP-10746. HttpServer2 should not load JspServlet. Contributed by Haohui Mai.
This commit is contained in:
parent
26ebdd849b
commit
fdd3bc5f45
|
@ -323,6 +323,8 @@ Trunk (Unreleased)
|
||||||
|
|
||||||
HADOOP-10996. Stop violence in the *_HOME (aw)
|
HADOOP-10996. Stop violence in the *_HOME (aw)
|
||||||
|
|
||||||
|
HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HADOOP-7761. Improve the performance of raw comparisons. (todd)
|
HADOOP-7761. Improve the performance of raw comparisons. (todd)
|
||||||
|
|
|
@ -44,6 +44,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.HadoopIllegalArgumentException;
|
import org.apache.hadoop.HadoopIllegalArgumentException;
|
||||||
|
@ -415,6 +416,17 @@ public final class HttpServer2 implements FilterContainer {
|
||||||
private static WebAppContext createWebAppContext(String name,
|
private static WebAppContext createWebAppContext(String name,
|
||||||
Configuration conf, AccessControlList adminsAcl, final String appDir) {
|
Configuration conf, AccessControlList adminsAcl, final String appDir) {
|
||||||
WebAppContext ctx = new WebAppContext();
|
WebAppContext ctx = new WebAppContext();
|
||||||
|
ctx.setDefaultsDescriptor(null);
|
||||||
|
ServletHolder holder = new ServletHolder(new DefaultServlet());
|
||||||
|
Map<String, String> params = ImmutableMap. <String, String> 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.setDisplayName(name);
|
||||||
ctx.setContextPath("/");
|
ctx.setContextPath("/");
|
||||||
ctx.setWar(appDir + "/" + name);
|
ctx.setWar(appDir + "/" + name);
|
||||||
|
|
Loading…
Reference in New Issue