From 6a04563578297598d248731bdbef5357df8fba91 Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 27 Dec 2014 00:10:14 +0100 Subject: [PATCH] Init Jetty using setDefaultDescriptor (web.xml) to defaults/web.xml so web.xml in defaults dir is applied first and optional DATA/SETTINGS/web.xml loaded on top. By using this Jetty feature (default web.xml) we assure that changes to the default are applied to existing installations and individual addition/changes are still respected. --- defaults/web.xml | 2 +- source/net/yacy/http/Jetty9HttpServerImpl.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/defaults/web.xml b/defaults/web.xml index accfa2677..a13e090aa 100644 --- a/defaults/web.xml +++ b/defaults/web.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> YaCy Decentralized Web Search diff --git a/source/net/yacy/http/Jetty9HttpServerImpl.java b/source/net/yacy/http/Jetty9HttpServerImpl.java index c97f5baf1..c31517f61 100644 --- a/source/net/yacy/http/Jetty9HttpServerImpl.java +++ b/source/net/yacy/http/Jetty9HttpServerImpl.java @@ -116,13 +116,13 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer { // set web.xml to use // make use of Jetty feature to define web.xml other as default WEB-INF/web.xml - // look in DATA/SETTINGS or use the one in DEFAULTS + // and to use a DefaultsDescriptor merged with a individual web.xml + // use defaults/web.xml as default and look in DATA/SETTINGS for local addition/changes + htrootContext.setDefaultsDescriptor(sb.appPath + "/defaults/web.xml"); Resource webxml = Resource.newResource(sb.dataPath + "/DATA/SETTINGS/web.xml"); if (webxml.exists()) { htrootContext.setDescriptor(webxml.getName()); - } else { - htrootContext.setDescriptor(sb.appPath + "/defaults/web.xml"); - } + } } catch (IOException ex) { if (htrootContext.getBaseResource() == null) {