This commit is contained in:
Robert Gaggl 2017-03-27 14:17:46 +02:00 committed by Tobi Schäfer
parent 7e39892c4a
commit 4b9b78bb0f

View file

@ -473,10 +473,10 @@ public class ApplicationManager implements XmlRpcHandler {
} }
// bind to Jetty HTTP server // bind to Jetty HTTP server
if (ApplicationManager.this.jetty != null) { if (jetty != null) {
if(ApplicationManager.this.context == null) { if (context == null) {
ApplicationManager.this.context = new ContextHandlerCollection(); context = new ContextHandlerCollection();
ApplicationManager.this.jetty.getHttpServer().setHandler(ApplicationManager.this.context); jetty.getHttpServer().setHandler(context);
} }
// if there is a static direcory specified, mount it // if there is a static direcory specified, mount it
@ -501,9 +501,8 @@ public class ApplicationManager implements XmlRpcHandler {
Class servletClass = servletClassName == null ? Class servletClass = servletClassName == null ?
EmbeddedServletClient.class : Class.forName(servletClassName); EmbeddedServletClient.class : Class.forName(servletClassName);
ServletHolder holder = new ServletHolder(servletClass); ServletHolder holder = new ServletHolder(servletClass);
appContext.addServlet(holder, "/*"); //$NON-NLS-1$ holder.setInitParameter("application", appName);
appContext.addServlet(holder, "/*");
holder.setInitParameter("application", appName); //$NON-NLS-1$
if (this.cookieDomain != null) { if (this.cookieDomain != null) {
holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$ holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$
@ -529,9 +528,9 @@ public class ApplicationManager implements XmlRpcHandler {
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$ holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
} }
if (this.protectedStaticDir != null) { if (protectedStaticDir != null) {
File protectedContent = getAbsoluteFile(this.protectedStaticDir); File protectedContent = getAbsoluteFile(protectedStaticDir);
this.appContext.setResourceBase(protectedContent.getPath()); appContext.setResourceBase(protectedContent.getPath());
getLogger().info("Serving protected static from " + getLogger().info("Serving protected static from " +
protectedContent.getPath()); protectedContent.getPath());
} }