From 5d041ad54f1796d0640623b06678bc58ce4fec93 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 7 May 2015 16:23:53 +1000 Subject: [PATCH] 466645 Allow XmlConfiguration Properties to use Elements or Attributes --- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../src/main/resources/exampleserver.xml | 2 +- .../src/main/resources/fileserver.xml | 2 +- .../src/main/resources/jetty-otherserver.xml | 2 +- .../src/main/config/etc/jetty-alpn.xml | 6 +- .../src/main/config/etc/jetty-annotations.xml | 2 +- .../src/main/config/etc/jetty-cdi.xml | 2 +- .../src/main/config/etc/jetty-deploy.xml | 4 +- .../resources/binding-test-contexts-1.xml | 2 +- .../src/test/resources/jetty-deploy-wars.xml | 2 +- .../resources/jetty-deploymgr-contexts.xml | 2 +- .../src/test/resources/jetty-http.xml | 2 +- jetty-deploy/src/test/resources/jetty.xml | 2 +- .../src/test/resources/webapps/foo.xml | 2 +- .../demo-base/webapps/example-moved.xml | 2 +- .../src/main/resources/etc/hawtio.xml | 2 +- .../src/main/resources/etc/jamon.xml | 2 +- .../src/main/resources/etc/jetty-setuid.xml | 10 +- .../src/main/resources/etc/jetty-started.xml | 2 +- .../src/main/resources/etc/jminix.xml | 2 +- .../src/main/resources/etc/jolokia.xml | 2 +- .../src/main/config/etc/jetty-http2.xml | 4 +- .../src/main/config/etc/jetty-http2c.xml | 4 +- .../src/main/config/etc/jetty-infinispan.xml | 2 +- jetty-jaas/src/main/config/etc/jetty-jaas.xml | 4 +- .../src/main/config/etc/jetty-jmx-remote.xml | 8 +- jetty-jmx/src/main/config/etc/jetty-jmx.xml | 2 +- .../src/main/config/etc/jetty-monitor.xml | 2 +- .../jettyhome/etc/jetty-deployer.xml | 2 +- .../jettyhome/etc/jetty-selector.xml | 2 +- .../jetty-osgi-boot/jettyhome/etc/jetty.xml | 2 +- .../contexts/httpservice.xml | 2 +- .../src/main/context/acme.xml | 2 +- .../src/test/config/etc/jetty-deployer.xml | 2 +- .../src/test/config/etc/jetty-http.xml | 2 +- .../src/test/config/etc/jetty-http2.xml | 2 +- .../src/test/config/etc/jetty-https.xml | 2 +- .../src/test/config/etc/jetty-ssl.xml | 2 +- .../src/test/config/etc/jetty-testrealm.xml | 2 +- .../src/test/config/etc/jetty.xml | 2 +- .../src/main/config/etc/jetty-overlay.xml | 2 +- .../instances/myfoo=blue/WEB-INF/overlay.xml | 2 +- .../instances/myfoo=green/WEB-INF/overlay.xml | 2 +- .../instances/myfoo=red/WEB-INF/overlay.xml | 2 +- .../instances/root=root/WEB-INF/overlay.xml | 2 +- .../templates/myfoo=foo/WEB-INF/jetty-web.xml | 2 +- .../templates/myfoo=foo/WEB-INF/template.xml | 2 +- .../templates/root/WEB-INF/overlay.xml | 2 +- jetty-plus/src/main/config/etc/jetty-plus.xml | 2 +- .../src/main/config/etc/jetty-proxy.xml | 2 +- .../main/config/etc/example-quickstart.xml | 2 +- .../src/main/config/etc/jetty-rewrite.xml | 8 +- .../jetty-rewrite.xml | 2 +- .../src/main/config/etc/jetty-rhttp.xml | 2 +- .../src/main/config/etc/home-base-warning.xml | 4 +- .../src/main/config/etc/jetty-debuglog.xml | 4 +- .../src/main/config/etc/jetty-gzip.xml | 10 +- .../src/main/config/etc/jetty-http.xml | 18 +- .../src/main/config/etc/jetty-https.xml | 2 +- .../src/main/config/etc/jetty-ipaccess.xml | 2 +- .../main/config/etc/jetty-lowresources.xml | 14 +- .../src/main/config/etc/jetty-requestlog.xml | 22 +- .../src/main/config/etc/jetty-ssl-context.xml | 16 +- .../config/etc/jetty-ssl-extended-context.xml | 2 +- .../src/main/config/etc/jetty-ssl.xml | 18 +- .../src/main/config/etc/jetty-stats.xml | 2 +- jetty-server/src/main/config/etc/jetty.xml | 28 +- .../src/main/config/etc/jetty-logging.xml | 4 +- .../org/eclipse/jetty/util/StringUtil.java | 13 + .../eclipse/jetty/xml/XmlConfiguration.java | 372 +++++++++++++----- .../org/eclipse/jetty/xml/configure_9_0.dtd | 9 - .../org/eclipse/jetty/xml/configure_9_3.dtd | 280 +++++++++++++ .../jetty/xml/XmlConfigurationTest.java | 56 ++- .../org/eclipse/jetty/xml/configure.xml | 2 +- .../org/eclipse/jetty/xml/mortbay.xml | 2 +- .../jetty/test/HttpInputIntegrationTest.java | 2 +- .../src/test/resources/DefaultHandler.xml | 2 +- .../src/test/resources/NIOHttp.xml | 2 +- .../src/test/resources/NIOHttps.xml | 2 +- .../src/test/resources/RFC2616Base.xml | 2 +- .../src/test/resources/RFC2616_Filters.xml | 2 +- .../src/test/resources/RFC2616_Redirects.xml | 2 +- .../RFC2616/rfc2616-webapp.xml | 2 +- .../src/test/resources/test-jndi.xml | 2 +- .../src/test/resources/test-spec.xml | 2 +- .../src/test/resources/test.xml | 2 +- .../config/demo-base/webapps/test-jaas.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../embedded-jetty-web-for-webbundle.xml | 2 +- .../demo-base/etc/demo-rewrite-rules.xml | 2 +- .../main/config/demo-base/etc/test-realm.xml | 2 +- .../main/config/demo-base/webapps/test.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../main/templates/jetty-test-jndi-header.xml | 2 +- .../main/templates/plugin-context-header.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-env.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../templates/annotations-context-header.xml | 2 +- .../main/templates/plugin-context-header.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-env.xml | 2 +- .../src/main/webapp/WEB-INF/jetty-web.xml | 2 +- .../src/test/jetty-plugin-env.xml | 2 +- 103 files changed, 788 insertions(+), 288 deletions(-) create mode 100644 jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_3.dtd diff --git a/examples/async-rest/async-rest-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/examples/async-rest/async-rest-webapp/src/main/webapp/WEB-INF/jetty-web.xml index 9376677fe801..c15dc38f119a 100644 --- a/examples/async-rest/async-rest-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/examples/async-rest/async-rest-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-cdi/cdi-servlet/src/main/config/etc/jetty-cdi.xml b/jetty-cdi/cdi-servlet/src/main/config/etc/jetty-cdi.xml index f89ed7fc3407..79ebdaee517f 100644 --- a/jetty-cdi/cdi-servlet/src/main/config/etc/jetty-cdi.xml +++ b/jetty-cdi/cdi-servlet/src/main/config/etc/jetty-cdi.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/main/config/etc/jetty-deploy.xml b/jetty-deploy/src/main/config/etc/jetty-deploy.xml index 813012c2a551..4544362f2aee 100644 --- a/jetty-deploy/src/main/config/etc/jetty-deploy.xml +++ b/jetty-deploy/src/main/config/etc/jetty-deploy.xml @@ -1,5 +1,5 @@ - + @@ -39,7 +39,7 @@ - / + / /etc/webdefault.xml diff --git a/jetty-deploy/src/test/resources/binding-test-contexts-1.xml b/jetty-deploy/src/test/resources/binding-test-contexts-1.xml index 3c6a950c00ef..d49cf705c04c 100644 --- a/jetty-deploy/src/test/resources/binding-test-contexts-1.xml +++ b/jetty-deploy/src/test/resources/binding-test-contexts-1.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/test/resources/jetty-deploy-wars.xml b/jetty-deploy/src/test/resources/jetty-deploy-wars.xml index 9933cb6ed988..1760a674f517 100644 --- a/jetty-deploy/src/test/resources/jetty-deploy-wars.xml +++ b/jetty-deploy/src/test/resources/jetty-deploy-wars.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml index 8d55d22010c6..b16fbd7101ee 100644 --- a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml +++ b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/test/resources/jetty-http.xml b/jetty-deploy/src/test/resources/jetty-http.xml index 42b889b38306..7fa6def071a2 100644 --- a/jetty-deploy/src/test/resources/jetty-http.xml +++ b/jetty-deploy/src/test/resources/jetty-http.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/test/resources/jetty.xml b/jetty-deploy/src/test/resources/jetty.xml index 18e6a403beae..a08e270f99bb 100644 --- a/jetty-deploy/src/test/resources/jetty.xml +++ b/jetty-deploy/src/test/resources/jetty.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-deploy/src/test/resources/webapps/foo.xml b/jetty-deploy/src/test/resources/webapps/foo.xml index e7c6e9daed06..f0a96119a3f2 100644 --- a/jetty-deploy/src/test/resources/webapps/foo.xml +++ b/jetty-deploy/src/test/resources/webapps/foo.xml @@ -1,5 +1,5 @@ - + /foo diff --git a/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml b/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml index 53d6bfd3e7f0..e9ad12443bc2 100644 --- a/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml +++ b/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-distribution/src/main/resources/etc/hawtio.xml b/jetty-distribution/src/main/resources/etc/hawtio.xml index d6144358ec7b..cc87fce9879d 100644 --- a/jetty-distribution/src/main/resources/etc/hawtio.xml +++ b/jetty-distribution/src/main/resources/etc/hawtio.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-distribution/src/main/resources/etc/jamon.xml b/jetty-distribution/src/main/resources/etc/jamon.xml index 4a1c0d371d00..ec1d3f509bb0 100644 --- a/jetty-distribution/src/main/resources/etc/jamon.xml +++ b/jetty-distribution/src/main/resources/etc/jamon.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-distribution/src/main/resources/etc/jetty-setuid.xml b/jetty-distribution/src/main/resources/etc/jetty-setuid.xml index 75a4ebdf3967..cb33a1a54297 100644 --- a/jetty-distribution/src/main/resources/etc/jetty-setuid.xml +++ b/jetty-distribution/src/main/resources/etc/jetty-setuid.xml @@ -1,5 +1,5 @@ - + @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/jetty-distribution/src/main/resources/etc/jminix.xml b/jetty-distribution/src/main/resources/etc/jminix.xml index 21206666a235..15c699ea4b43 100644 --- a/jetty-distribution/src/main/resources/etc/jminix.xml +++ b/jetty-distribution/src/main/resources/etc/jminix.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-distribution/src/main/resources/etc/jolokia.xml b/jetty-distribution/src/main/resources/etc/jolokia.xml index 3bc4dc1cc2e2..b6e240497a35 100644 --- a/jetty-distribution/src/main/resources/etc/jolokia.xml +++ b/jetty-distribution/src/main/resources/etc/jolokia.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml b/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml index 18880e6846a7..423dd8056461 100644 --- a/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml +++ b/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml b/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml index bf021e386d48..ab9a06069480 100644 --- a/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml +++ b/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/jetty-infinispan/src/main/config/etc/jetty-infinispan.xml b/jetty-infinispan/src/main/config/etc/jetty-infinispan.xml index 6e6c1a207f56..55be61bd2010 100644 --- a/jetty-infinispan/src/main/config/etc/jetty-infinispan.xml +++ b/jetty-infinispan/src/main/config/etc/jetty-infinispan.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-jaas/src/main/config/etc/jetty-jaas.xml b/jetty-jaas/src/main/config/etc/jetty-jaas.xml index 262591140c3e..4e42594db61d 100644 --- a/jetty-jaas/src/main/config/etc/jetty-jaas.xml +++ b/jetty-jaas/src/main/config/etc/jetty-jaas.xml @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ java.security.auth.login.config - / + / diff --git a/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml b/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml index c71b7a8aa391..48c8760a161d 100644 --- a/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml +++ b/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml @@ -1,5 +1,5 @@ - + @@ -28,9 +28,9 @@ rmi - - - /jndi/rmi://:/jmxrmi + + + /jndi/rmi://:/jmxrmi org.eclipse.jetty.jmx:name=rmiconnectorserver diff --git a/jetty-jmx/src/main/config/etc/jetty-jmx.xml b/jetty-jmx/src/main/config/etc/jetty-jmx.xml index 4c67b8bc78d9..e07ea7443558 100644 --- a/jetty-jmx/src/main/config/etc/jetty-jmx.xml +++ b/jetty-jmx/src/main/config/etc/jetty-jmx.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-monitor/src/main/config/etc/jetty-monitor.xml b/jetty-monitor/src/main/config/etc/jetty-monitor.xml index dcb15a6c40bc..e2cfe0674338 100644 --- a/jetty-monitor/src/main/config/etc/jetty-monitor.xml +++ b/jetty-monitor/src/main/config/etc/jetty-monitor.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml index b03a648e3d6b..19b3a5db090b 100644 --- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-selector.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-selector.xml index 0613a1ab05a4..9c9dfbaf8da3 100644 --- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-selector.xml +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-selector.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty.xml index a4bc2fe4c10f..a3850c925902 100644 --- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty.xml +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml b/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml index 6aae6e9bf09c..e1044c88bcd3 100644 --- a/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml +++ b/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml index 13258ae68f9b..3362c1bfd0e7 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml index f27cec070bd8..c9d497e2c15a 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml index d80cf81b3ed8..a7b0f0746b59 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-testrealm.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-testrealm.xml index d26b427b5c2f..4c8cb533cc54 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-testrealm.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-testrealm.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml index a4bc2fe4c10f..a3850c925902 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-overlay-deployer/src/main/config/etc/jetty-overlay.xml b/jetty-overlay-deployer/src/main/config/etc/jetty-overlay.xml index 72af906e92f0..60f23d677cba 100644 --- a/jetty-overlay-deployer/src/main/config/etc/jetty-overlay.xml +++ b/jetty-overlay-deployer/src/main/config/etc/jetty-overlay.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml index 8e7954fe8ce3..8d29a8aea26f 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/overlay.xml index 1a962ed2a85c..7a15e73af245 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/overlay.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/overlay.xml index c225d33f39b2..90685db44fc6 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/overlay.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/root=root/WEB-INF/overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/root=root/WEB-INF/overlay.xml index 752b7088ee06..ca23e18bac3c 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/root=root/WEB-INF/overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/root=root/WEB-INF/overlay.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-proxy/src/main/config/etc/jetty-proxy.xml b/jetty-proxy/src/main/config/etc/jetty-proxy.xml index 046537fc225c..20ef31890eab 100644 --- a/jetty-proxy/src/main/config/etc/jetty-proxy.xml +++ b/jetty-proxy/src/main/config/etc/jetty-proxy.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-quickstart/src/main/config/etc/example-quickstart.xml b/jetty-quickstart/src/main/config/etc/example-quickstart.xml index 3f02e60cf497..ddeedf9b7459 100644 --- a/jetty-quickstart/src/main/config/etc/example-quickstart.xml +++ b/jetty-quickstart/src/main/config/etc/example-quickstart.xml @@ -1,5 +1,5 @@ - + @@ -16,9 +16,9 @@ - - - + + + diff --git a/jetty-rewrite/src/test/resources/org.mortbay.jetty.rewrite.handler/jetty-rewrite.xml b/jetty-rewrite/src/test/resources/org.mortbay.jetty.rewrite.handler/jetty-rewrite.xml index 6f0dede49321..9ac510991d22 100644 --- a/jetty-rewrite/src/test/resources/org.mortbay.jetty.rewrite.handler/jetty-rewrite.xml +++ b/jetty-rewrite/src/test/resources/org.mortbay.jetty.rewrite.handler/jetty-rewrite.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-rhttp/jetty-rhttp-connector/src/main/config/etc/jetty-rhttp.xml b/jetty-rhttp/jetty-rhttp-connector/src/main/config/etc/jetty-rhttp.xml index 21417947ab11..7d7a9b491e02 100644 --- a/jetty-rhttp/jetty-rhttp-connector/src/main/config/etc/jetty-rhttp.xml +++ b/jetty-rhttp/jetty-rhttp-connector/src/main/config/etc/jetty-rhttp.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-server/src/main/config/etc/home-base-warning.xml b/jetty-server/src/main/config/etc/home-base-warning.xml index b83f36f63d3f..4d568f138ea1 100644 --- a/jetty-server/src/main/config/etc/home-base-warning.xml +++ b/jetty-server/src/main/config/etc/home-base-warning.xml @@ -1,8 +1,8 @@ - + - \ No newline at end of file + diff --git a/jetty-server/src/main/config/etc/jetty-debuglog.xml b/jetty-server/src/main/config/etc/jetty-debuglog.xml index b4a2f5645af5..adbb10a5d434 100644 --- a/jetty-server/src/main/config/etc/jetty-debuglog.xml +++ b/jetty-server/src/main/config/etc/jetty-debuglog.xml @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - /yyyy_mm_dd.debug.log + /yyyy_mm_dd.debug.log diff --git a/jetty-server/src/main/config/etc/jetty-gzip.xml b/jetty-server/src/main/config/etc/jetty-gzip.xml index 35c8dcc70b0e..f26ef0b5a150 100644 --- a/jetty-server/src/main/config/etc/jetty-gzip.xml +++ b/jetty-server/src/main/config/etc/jetty-gzip.xml @@ -1,5 +1,5 @@ - + @@ -13,12 +13,12 @@ - - - + + + - + diff --git a/jetty-server/src/main/config/etc/jetty-http.xml b/jetty-server/src/main/config/etc/jetty-http.xml index 963f8db2b3de..1a82aef5a2f6 100644 --- a/jetty-server/src/main/config/etc/jetty-http.xml +++ b/jetty-server/src/main/config/etc/jetty-http.xml @@ -1,5 +1,5 @@ - + @@ -22,8 +22,8 @@ - - + + diff --git a/jetty-server/src/main/config/etc/jetty-ipaccess.xml b/jetty-server/src/main/config/etc/jetty-ipaccess.xml index d87ca02cfa85..d8236a99a0aa 100644 --- a/jetty-server/src/main/config/etc/jetty-ipaccess.xml +++ b/jetty-server/src/main/config/etc/jetty-ipaccess.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-server/src/main/config/etc/jetty-lowresources.xml b/jetty-server/src/main/config/etc/jetty-lowresources.xml index 5884c42b99b1..f6442c8b5e71 100644 --- a/jetty-server/src/main/config/etc/jetty-lowresources.xml +++ b/jetty-server/src/main/config/etc/jetty-lowresources.xml @@ -1,5 +1,5 @@ - + @@ -10,12 +10,12 @@ - - - - - - + + + + + + diff --git a/jetty-server/src/main/config/etc/jetty-requestlog.xml b/jetty-server/src/main/config/etc/jetty-requestlog.xml index 4e512d1db99b..a29dc638f053 100644 --- a/jetty-server/src/main/config/etc/jetty-requestlog.xml +++ b/jetty-server/src/main/config/etc/jetty-requestlog.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,6 @@ - jetty.requestlog.filePath @@ -23,15 +22,18 @@ - - - - - - - + + jetty.requestlog.filePath + requestlog.filename + /yyyy_mm_dd.request.log" + + + + + + - + diff --git a/jetty-server/src/main/config/etc/jetty-ssl-context.xml b/jetty-server/src/main/config/etc/jetty-ssl-context.xml index d1052e2a6c76..f6a8dcfedd95 100644 --- a/jetty-server/src/main/config/etc/jetty-ssl-context.xml +++ b/jetty-server/src/main/config/etc/jetty-ssl-context.xml @@ -1,5 +1,5 @@ - + @@ -7,14 +7,14 @@ - / - - - / - + / + + + / + - - + + SSL_RSA_WITH_DES_CBC_SHA diff --git a/jetty-server/src/main/config/etc/jetty-ssl-extended-context.xml b/jetty-server/src/main/config/etc/jetty-ssl-extended-context.xml index 7069affc56e6..29a7a3310e62 100644 --- a/jetty-server/src/main/config/etc/jetty-ssl-extended-context.xml +++ b/jetty-server/src/main/config/etc/jetty-ssl-extended-context.xml @@ -1,5 +1,5 @@ - + diff --git a/jetty-server/src/main/config/etc/jetty-ssl.xml b/jetty-server/src/main/config/etc/jetty-ssl.xml index 4e1798235c53..30169d023e28 100644 --- a/jetty-server/src/main/config/etc/jetty-ssl.xml +++ b/jetty-server/src/main/config/etc/jetty-ssl.xml @@ -1,5 +1,5 @@ - + @@ -15,8 +15,8 @@ - - + + diff --git a/jetty-server/src/main/config/etc/jetty.xml b/jetty-server/src/main/config/etc/jetty.xml index cbd0a1998e07..c55953f8f34c 100644 --- a/jetty-server/src/main/config/etc/jetty.xml +++ b/jetty-server/src/main/config/etc/jetty.xml @@ -1,5 +1,5 @@ - + @@ -46,9 +46,9 @@ --> - - - + + + false @@ -78,15 +78,15 @@ - - - - - - - + + + + + + + - + 5000 - - + + diff --git a/jetty-util/src/main/config/etc/jetty-logging.xml b/jetty-util/src/main/config/etc/jetty-logging.xml index 3f3e72b51b9a..dc7fe9ed14f0 100644 --- a/jetty-util/src/main/config/etc/jetty-logging.xml +++ b/jetty-util/src/main/config/etc/jetty-logging.xml @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - /yyyy_mm_dd.stderrout.log + /yyyy_mm_dd.stderrout.log diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java index 33655ccb4dd5..88e10f1cfddd 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java @@ -746,4 +746,17 @@ public static String[] arrayFromString(String s) return s.substring(1,s.length()-1).split(" *, *"); } + + /* ------------------------------------------------------------ */ + /** The String value of an Object + *

This method calls {@link String#valueOf(Object)} unless the object is null, + * in which case null is returned

+ * @param object The object + * @return String value or null + */ + public static String valueOf(Object object) + { + return object==null?null:String.valueOf(object); + } + } diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index f5c404a79c13..4cd73c9b305a 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -52,6 +52,7 @@ import org.eclipse.jetty.util.ArrayQueue; import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.log.Log; @@ -96,6 +97,7 @@ private static XmlParser initParser() URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd"); URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd"); URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd"); + URL config93 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_3.dtd"); parser.redirectEntity("configure.dtd",config90); parser.redirectEntity("configure_1_0.dtd",config60); parser.redirectEntity("configure_1_1.dtd",config60); @@ -104,13 +106,14 @@ private static XmlParser initParser() parser.redirectEntity("configure_6_0.dtd",config60); parser.redirectEntity("configure_7_6.dtd",config76); parser.redirectEntity("configure_9_0.dtd",config90); + parser.redirectEntity("configure_9_3.dtd",config93); - parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config90); - parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config90); - parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config90); + parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config93); + parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config93); + parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config93); - parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config90); - parser.redirectEntity("-//Jetty//Configure//EN",config90); + parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config93); + parser.redirectEntity("-//Jetty//Configure//EN",config93); return parser; } @@ -270,9 +273,11 @@ public Object configure() throws Exception public void initializeDefaults(Object object) { } + private static class JettyXmlConfiguration implements ConfigurationProcessor { + private String _url; XmlParser.Node _root; XmlConfiguration _configuration; @@ -429,6 +434,12 @@ public void configure(Object obj, XmlParser.Node cfg, int i) throws Exception case "Property": propertyObj(node); break; + case "SystemProperty": + systemPropertyObj(node); + break; + case "Env": + envObj(node); + break; default: throw new IllegalStateException("Unknown tag: " + tag + " in " + _url); } @@ -686,49 +697,36 @@ private Object get(Object obj, XmlParser.Node node) throws Exception */ private Object call(Object obj, XmlParser.Node node) throws Exception { - String id = node.getAttribute("id"); - Class oClass = nodeClass(node); - if (oClass != null) - obj = null; - else if (obj != null) - oClass = obj.getClass(); - if (oClass == null) - throw new IllegalArgumentException(node.toString()); + AttrOrElementNode aoeNode=new AttrOrElementNode(obj,node,"Id","Name","Class","Arg"); + String id = aoeNode.getString("Id"); + String name = aoeNode.getString("Name"); + String clazz = aoeNode.getString("Class"); + List args = aoeNode.getList("Arg"); - int size = 0; - int argIndex = node.size(); - for (int i = 0; i < node.size(); i++) + + Class oClass; + if (clazz!=null) { - Object o = node.get(i); - if (o instanceof String) - continue; - if (!((XmlParser.Node)o).getTag().equals("Arg")) - { - argIndex = i; - break; - } - size++; + // static call + oClass=Loader.loadClass(XmlConfiguration.class,clazz); + obj=null; } - - Object[] arg = new Object[size]; - for (int i = 0, j = 0; j < size; i++) + else if (obj!=null) { - Object o = node.get(i); - if (o instanceof String) - continue; - arg[j++] = value(obj,(XmlParser.Node)o); + oClass = obj.getClass(); } - - String method = node.getAttribute("name"); + else + throw new IllegalArgumentException(node.toString()); + if (LOG.isDebugEnabled()) - LOG.debug("XML call " + method); + LOG.debug("XML call " + name); try { - Object n= TypeUtil.call(oClass,method,obj,arg); + Object n= TypeUtil.call(oClass,name,obj,args.toArray(new Object[args.size()])); if (id != null) _configuration.getIdMap().put(id,n); - configure(n,node,argIndex); + configure(n,node,aoeNode.getNext()); return n; } catch (NoSuchMethodException e) @@ -943,76 +941,124 @@ private Object newMap(Object obj, XmlParser.Node node) throws Exception */ private Object propertyObj(XmlParser.Node node) throws Exception { - String idAttr = node.getAttribute("id"); - String nameAttr = node.getAttribute("name"); - String defaultValue = node.getAttribute("default"); + AttrOrElementNode aoeNode=new AttrOrElementNode(node,"Id","Name","Deprecated","Default"); + String id = aoeNode.getString("Id"); + String name = aoeNode.getString("Name",true); + List deprecated = aoeNode.getList("Deprecated"); + String dftValue = aoeNode.getString("Default"); - Object value = null; + // Look for a value Map properties = _configuration.getProperties(); - if (properties != null && nameAttr != null) - value = resolve(properties, nameAttr); - - if (value == null && defaultValue != null) - value = interpolate(properties, defaultValue); - - if (idAttr != null) - _configuration.getIdMap().put(idAttr, value); - - if (value != null) - configure(value, node, 0); + String value = properties.get(name); + + // Look for a deprecated name value + if (value==null && !deprecated.isEmpty()) + { + for (Object d : deprecated) + { + value = properties.get(StringUtil.valueOf(d)); + if (value!=null) + { + LOG.warn("Property '{}' is deprecated, use '{}' instead", d, name); + break; + } + } + } + + // use default value + if (value==null) + value=dftValue; + // Set value if ID set + if (id != null) + _configuration.getIdMap().put(id, value); return value; } - private String resolve(Map properties, String nameAttr) + /* + * Get a SystemProperty. + * + * @param node + * @return + * @exception Exception + */ + private Object systemPropertyObj(XmlParser.Node node) throws Exception { - String preferredName = null; - String[] names = nameAttr.split(","); - for (String name : names) + AttrOrElementNode aoeNode=new AttrOrElementNode(node,"Id","Name","Deprecated","Default"); + String id = aoeNode.getString("Id"); + String name = aoeNode.getString("Name",true); + List deprecated = aoeNode.getList("Deprecated"); + String dftValue = aoeNode.getString("Default"); + + // Look for a value + String value = System.getProperty(name); + + // Look for a deprecated name value + if (value==null && !deprecated.isEmpty()) { - name = name.trim(); - if (name.length() == 0) - continue; - if (preferredName == null) - preferredName = name; - - String value = properties.get(name); - if (value != null) + for (Object d : deprecated) { - if (!name.equals(preferredName)) - LOG.warn("Property '{}' is deprecated, use '{}' instead", name, preferredName); - return value; + value = System.getProperty(StringUtil.valueOf(d)); + if (value!=null) + { + LOG.warn("Property '{}' is deprecated, use '{}' instead", d, name); + break; + } } } - return null; - } + + // use default value + if (value==null) + value=dftValue; + + // Set value if ID set + if (id != null) + _configuration.getIdMap().put(id, value); - private String interpolate(Map properties, String text) + return value; + } + + /* + * Get a Environment Property. + * + * @param node + * @return + * @exception Exception + */ + private Object envObj(XmlParser.Node node) throws Exception { - StringBuilder result = new StringBuilder(); - Matcher matcher = __propertyPattern.matcher(text); - int start = 0; - while (matcher.find(start)) + AttrOrElementNode aoeNode=new AttrOrElementNode(node,"Id","Name","Deprecated","Default"); + String id = aoeNode.getString("Id"); + String name = aoeNode.getString("Name",true); + List deprecated = aoeNode.getList("Deprecated"); + String dftValue = aoeNode.getString("Default"); + + // Look for a value + String value = System.getenv(name); + + // Look for a deprecated name value + if (value==null && !deprecated.isEmpty()) { - int match = matcher.start(); - result.append(text.substring(start, match)); - String name = matcher.group(1); - String dftValue = null; - int bar = name.indexOf('|'); - if (bar > 0) + for (Object d : deprecated) { - dftValue = name.substring(bar + 1).trim(); - name = name.substring(0, bar).trim(); + value = System.getenv(StringUtil.valueOf(d)); + if (value!=null) + { + LOG.warn("Property '{}' is deprecated, use '{}' instead", d, name); + break; + } } - String value = resolve(properties, name); - if (value == null) - value = dftValue; - result.append(value); - start = matcher.end(); } - result.append(text.substring(start, text.length())); - String r = result.toString(); - return r.isEmpty() ? null : r; + + // use default value + if (value==null) + value=dftValue; + + // Set value if ID set + if (id != null) + _configuration.getIdMap().put(id, value); + + return value; } /* @@ -1186,21 +1232,146 @@ private Object itemValue(Object obj, Object item) throws Exception if ("Property".equals(tag)) return propertyObj(node); if ("SystemProperty".equals(tag)) + return systemPropertyObj(node); + if ("Env".equals(tag)) + return envObj(node); + + LOG.warn("Unknown value tag: " + node,new Throwable()); + return null; + } + + + private class AttrOrElementNode + { + final Object _obj; + final XmlParser.Node _node; + final Set _elements = new HashSet<>(); + final int _next; + + AttrOrElementNode(XmlParser.Node node,String... elements ) { - String name = node.getAttribute("name"); - String defaultValue = node.getAttribute("default"); - return System.getProperty(name,defaultValue); + this(null,node,elements); } - if ("Env".equals(tag)) + + AttrOrElementNode(Object obj, XmlParser.Node node,String... elements ) + { + _obj=obj; + _node=node; + for (String e:elements) + _elements.add(e); + + int next=0; + for (Object o: _node) + { + if (o instanceof String) + { + if (((String)o).trim().length()==0) + { + next++; + continue; + } + break; + } + + if (!(o instanceof XmlParser.Node)) + break; + + XmlParser.Node n = (XmlParser.Node)o; + if (!_elements.contains(n.getTag())) + break; + + next++; + } + _next=next; + } + + public int getNext() { - String name = node.getAttribute("name"); - String defaultValue = node.getAttribute("default"); - String value=System.getenv(name); - return value==null?defaultValue:value; + return _next; } - LOG.warn("Unknown value tag: " + node,new Throwable()); - return null; + public String getString(String elementName) throws Exception + { + return StringUtil.valueOf(get(elementName,false)); + } + + public Object get(String elementName) throws Exception + { + return get(elementName,false); + } + + public String getString(String elementName, boolean manditory) throws Exception + { + return StringUtil.valueOf(get(elementName,manditory)); + } + + + public Object get(String elementName, boolean manditory) throws Exception + { + String attrName=StringUtil.asciiToLowerCase(elementName); + String attr = _node.getAttribute(attrName); + Object value=attr; + + for (int i=0;i<_next;i++) + { + Object o = _node.get(i); + if (!(o instanceof XmlParser.Node)) + continue; + XmlParser.Node n = (XmlParser.Node)o; + if (elementName.equals(n.getTag())) + { + if (attr!=null) + throw new IllegalStateException("Cannot have attr '"+attrName+"' and element '"+elementName+"'"); + + value=value(_obj,n); + break; + } + } + + if (manditory && value==null) + throw new IllegalStateException("Must have attr '"+attrName+"' or element '"+elementName+"'"); + + return value; + } + + public List getList(String elementName) throws Exception + { + return getList(elementName,false); + } + + public List getList(String elementName, boolean manditory) throws Exception + { + String attrName=StringUtil.asciiToLowerCase(elementName); + final List values=new ArrayList<>(); + + String attr = _node.getAttribute(attrName); + if (attr!=null) + { + for (String a : attr.split(",")) + values.add(a); + } + + for (int i=0;i<_next;i++) + { + Object o = _node.get(i); + if (!(o instanceof XmlParser.Node)) + continue; + XmlParser.Node n = (XmlParser.Node)o; + + if (elementName.equals(n.getTag())) + { + if (attr!=null) + throw new IllegalStateException("Cannot have attr '"+attrName+"' and element '"+elementName+"'"); + + values.add(value(_obj,n)); + } + } + + if (manditory && values.isEmpty()) + throw new IllegalStateException("Must have attr '"+attrName+"' or element '"+elementName+"'"); + + return values; + } } } @@ -1231,7 +1402,6 @@ public Object run() { try { - Properties properties = null; // Look for properties from start.jar diff --git a/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_0.dtd b/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_0.dtd index 542bc8c9dbca..7d6045bfb2f5 100644 --- a/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_0.dtd +++ b/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_0.dtd @@ -274,15 +274,6 @@ Property Element. This element allows arbitrary properties to be retrieved by name. The name attribute specifies the property name and the optional default argument provides a default value. - -A Property element can contain a sequence of elements such as Set, Put, Call, etc. -which act on the retrieved object: - - - - jdbcIdMgr - - --> diff --git a/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_3.dtd b/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_3.dtd new file mode 100644 index 000000000000..1b0b37f06b0b --- /dev/null +++ b/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_3.dtd @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java index 1cc9a61c836c..aeb90ca928ce 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java @@ -787,7 +787,7 @@ public void testWithMultiplePropertyNamesWithNoPropertyThenDefaultIsChosen() thr String defolt = "baz"; XmlConfiguration xmlConfiguration = new XmlConfiguration("" + "" + - " " + + " " + ""); DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); assertEquals(defolt, config.getFirst()); @@ -800,7 +800,7 @@ public void testWithMultiplePropertyNamesWithFirstPropertyThenFirstIsChosen() th String value = "foo"; XmlConfiguration xmlConfiguration = new XmlConfiguration("" + "" + - " " + + " " + ""); xmlConfiguration.getProperties().put(name, value); DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); @@ -814,7 +814,42 @@ public void testWithMultiplePropertyNamesWithSecondPropertyThenSecondIsChosen() String value = "bar"; XmlConfiguration xmlConfiguration = new XmlConfiguration("" + "" + - " " + + " " + + ""); + xmlConfiguration.getProperties().put(name, value); + DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); + assertEquals(value, config.getFirst()); + } + + @Test + public void testWithMultiplePropertyNamesWithDeprecatedThenThirdIsChosen() throws Exception + { + String name = "bar"; + String value = "bar"; + XmlConfiguration xmlConfiguration = new XmlConfiguration("" + + "" + + " " + + ""); + xmlConfiguration.getProperties().put(name, value); + DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); + assertEquals(value, config.getFirst()); + } + + @Test + public void testWithMultiplePropertyNameElementsWithDeprecatedThenThirdIsChosen() throws Exception + { + String name = "bar"; + String value = "bar"; + XmlConfiguration xmlConfiguration = new XmlConfiguration("" + + "" + + " " + + " " + + " foo" + + " foo" + + " "+name+"" + + " baz" + + " " + + " " + ""); xmlConfiguration.getProperties().put(name, value); DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); @@ -826,11 +861,16 @@ public void testPropertyNotFoundWithPropertyInDefaultValue() throws Exception { String name = "bar"; String value = "bar"; - String defaultValue = "_${bar}_${bar}_"; + String defaultValue = "___"; String expectedValue = "_" + value + "_" + value + "_"; XmlConfiguration xmlConfiguration = new XmlConfiguration("" + "" + - " " + + " " + + " " + + " not_found" + + " " + defaultValue + "" + + " " + + " " + ""); xmlConfiguration.getProperties().put(name, value); DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); @@ -843,7 +883,11 @@ public void testPropertyNotFoundWithPropertyInDefaultValueNotFoundWithDefault() String value = "bar"; XmlConfiguration xmlConfiguration = new XmlConfiguration("" + "" + - " " + + " " + + " " + + " " + + " " + + " " + ""); DefaultTestConfiguration config = (DefaultTestConfiguration)xmlConfiguration.configure(); assertEquals(value, config.getFirst()); diff --git a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml index 46c85718cfe6..29f3de97e15f 100644 --- a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml +++ b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml @@ -1,5 +1,5 @@ - + name diff --git a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml index 08e75df18143..c8e20cee271a 100644 --- a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml +++ b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml @@ -1,4 +1,4 @@ - + diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java index 91e4c173fe77..a6b1d10e8e8f 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java @@ -103,7 +103,7 @@ public static void beforeClass() throws Exception // SSL Context Factory for HTTPS and HTTP/2 String jetty_distro = System.getProperty("jetty.distro","../../jetty-distribution/target/distribution"); __sslContextFactory = new SslContextFactory(); - __sslContextFactory.setKeyStorePath(jetty_distro + "/etc/example-keystore"); + __sslContextFactory.setKeyStorePath(jetty_distro + "/../../../jetty-server/src/test/config/etc/keystore"); __sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); __sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); diff --git a/tests/test-integration/src/test/resources/DefaultHandler.xml b/tests/test-integration/src/test/resources/DefaultHandler.xml index 644e7f981c85..a0504083bfb7 100644 --- a/tests/test-integration/src/test/resources/DefaultHandler.xml +++ b/tests/test-integration/src/test/resources/DefaultHandler.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/NIOHttp.xml b/tests/test-integration/src/test/resources/NIOHttp.xml index a140c177453f..d58befb1b94c 100644 --- a/tests/test-integration/src/test/resources/NIOHttp.xml +++ b/tests/test-integration/src/test/resources/NIOHttp.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/NIOHttps.xml b/tests/test-integration/src/test/resources/NIOHttps.xml index cef54b53bf7f..5146752a77e5 100644 --- a/tests/test-integration/src/test/resources/NIOHttps.xml +++ b/tests/test-integration/src/test/resources/NIOHttps.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/RFC2616Base.xml b/tests/test-integration/src/test/resources/RFC2616Base.xml index 2c300d1498c0..a35088f5e89c 100644 --- a/tests/test-integration/src/test/resources/RFC2616Base.xml +++ b/tests/test-integration/src/test/resources/RFC2616Base.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/RFC2616_Filters.xml b/tests/test-integration/src/test/resources/RFC2616_Filters.xml index a798bfd986f2..73dbb385f872 100644 --- a/tests/test-integration/src/test/resources/RFC2616_Filters.xml +++ b/tests/test-integration/src/test/resources/RFC2616_Filters.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/RFC2616_Redirects.xml b/tests/test-integration/src/test/resources/RFC2616_Redirects.xml index a3cc7a3711ae..a777ad1e89f4 100644 --- a/tests/test-integration/src/test/resources/RFC2616_Redirects.xml +++ b/tests/test-integration/src/test/resources/RFC2616_Redirects.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml b/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml index 999cdc459397..36e624f56db0 100644 --- a/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml +++ b/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml @@ -1,5 +1,5 @@ - + /rfc2616-webapp /test-webapp-rfc2616.war diff --git a/tests/test-quickstart/src/test/resources/test-jndi.xml b/tests/test-quickstart/src/test/resources/test-jndi.xml index 14c09348451a..5f4ab4fa2dad 100644 --- a/tests/test-quickstart/src/test/resources/test-jndi.xml +++ b/tests/test-quickstart/src/test/resources/test-jndi.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-quickstart/src/test/resources/test-spec.xml b/tests/test-quickstart/src/test/resources/test-spec.xml index 99fc577205e4..a136d28395fb 100644 --- a/tests/test-quickstart/src/test/resources/test-spec.xml +++ b/tests/test-quickstart/src/test/resources/test-spec.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-quickstart/src/test/resources/test.xml b/tests/test-quickstart/src/test/resources/test.xml index 41eba0c29057..85156563b4dc 100644 --- a/tests/test-quickstart/src/test/resources/test.xml +++ b/tests/test-quickstart/src/test/resources/test.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml index e7830c65bcfd..ecd5e307bb01 100644 --- a/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml b/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml index 5d223e3cf5ae..9b4e89280b22 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml index f5f32e1f0cc8..f1b342bf3e42 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml index 5776e38f3538..0037cb490617 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jndi-webapp/src/main/templates/plugin-context-header.xml b/tests/test-webapps/test-jndi-webapp/src/main/templates/plugin-context-header.xml index 3e877a59ef36..bd97eb13606b 100644 --- a/tests/test-webapps/test-jndi-webapp/src/main/templates/plugin-context-header.xml +++ b/tests/test-webapps/test-jndi-webapp/src/main/templates/plugin-context-header.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-env.xml b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-env.xml index b7fa49f07b23..7899c45d5811 100644 --- a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-env.xml +++ b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-env.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml index fd4831e8b6ae..203f811885ae 100644 --- a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml index 030fd192cf61..e2cb8ec33c49 100644 --- a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + /proxy diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/annotations-context-header.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/annotations-context-header.xml index 50b598144556..ff2f6a1f969f 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/annotations-context-header.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/annotations-context-header.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/plugin-context-header.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/plugin-context-header.xml index 450eddacfd4c..36ff548a92b8 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/plugin-context-header.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/templates/plugin-context-header.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml index c15926b1a6fe..909ac83052eb 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml index 62b92f994d96..e360f5c202a5 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/test/jetty-plugin-env.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/test/jetty-plugin-env.xml index 774184305db5..23c4b5b9cbc0 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/test/jetty-plugin-env.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/test/jetty-plugin-env.xml @@ -1,5 +1,5 @@ - +