Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

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.

reger6a0456357829
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">
<!-- Default YaCy web.xml
- Note: if DATA/SETTINGS/web.xml exists, it takes preference
+ Note: if DATA/SETTINGS/web.xml exists, it is applied after defaults/web.xml
-->
<display-name>YaCy</display-name>
<description>Decentralized Web Search</description>
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) {