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.
pull/1/head
reger 10 years ago
parent 51ec9c1f44
commit 6a04563578

@ -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>

@ -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) {

Loading…
Cancel
Save