From f8b2413778eefb52d01726a5b44b74ae196a4761 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 3 Jan 2013 17:11:10 +0100 Subject: o Removing file locking issue on Windows. --- .../java/io/trygvis/appsh/booter/jetty/JettyWebServer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3