aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java b/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java
index 4783150..6a7b63a 100644
--- a/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java
+++ b/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java
@@ -93,6 +93,17 @@ public class JettyWebServer {
public ContextHandler toJetty() {
WebAppContext context = new WebAppContext();
+
+ /*
+ * By setting useFileMappedBuffer we prevent Jetty from memory-mapping the static resources
+ *
+ * The default servlet can be configured by setting parameters on the context in addition to the default
+ * servlet's init params, saving us from injecting the DefaultServlet programatically.
+ *
+ * http://stackoverflow.com/questions/184312/how-to-make-jetty-dynamically-load-static-pages
+ */
+ context.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
+
context.setContextPath(this.contextPath);
context.setWar(webapp.getAbsolutePath());
if (extraClasspath != null) {