From 7ac18fc215932a4dd376d17b17d9131d4d19506b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 16 Aug 2017 05:05:04 -0700 Subject: [PATCH 01/11] Javadoc build doesn't need to be offline --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0016dc734dd..6d98a5333cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ node { stage('Javadoc') { withEnv(mvnEnv) { timeout(time: 20, unit: 'MINUTES') { - sh "mvn --offline -B javadoc:javadoc" + sh "mvn -B javadoc:javadoc" } } } From b8ccd444ae805fcb456fa2fb99ea9c3b583ef8ce Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 16 Aug 2017 08:50:13 -0700 Subject: [PATCH 02/11] Bumping jetty-bom to same SNAPSHOT version as rest of project --- jetty-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-bom/pom.xml b/jetty-bom/pom.xml index bb45596285d..94cc7ca6961 100644 --- a/jetty-bom/pom.xml +++ b/jetty-bom/pom.xml @@ -6,7 +6,7 @@ 4.0.0 jetty-bom - 9.3.20-SNAPSHOT + 9.3.22-SNAPSHOT Jetty :: Bom Jetty BOM artifact http://www.eclipse.org/jetty From 9c7af338060102684cba3d83b239a95fb39e2891 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 16 Aug 2017 09:34:07 -0700 Subject: [PATCH 03/11] Issue #1737 - fixing up ResourceHandler behavior with welcome files --- .../org/eclipse/jetty/server/handler/ResourceHandler.java | 6 +++--- .../eclipse/jetty/server/handler/ResourceHandlerTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index b5e19ee9461..9b5f4ca3e38 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -91,15 +91,15 @@ public class ResourceHandler extends HandlerWrapper implements ResourceFactory,W if (_welcomes == null) return null; - String welcome_servlet = null; for (int i = 0; i < _welcomes.length; i++) { String welcome_in_context = URIUtil.addPaths(pathInContext,_welcomes[i]); Resource welcome = getResource(welcome_in_context); if (welcome != null && welcome.exists()) - return _welcomes[i]; + return welcome_in_context; } - return welcome_servlet; + // not found + return null; } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java index e56cfb81b80..2a4601ef605 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java @@ -254,7 +254,7 @@ public class ResourceHandlerTest HttpTester.Response response = HttpTester.parseResponse( _local.getResponse("GET /resource/directory/ HTTP/1.0\r\n\r\n")); assertThat(response.getStatus(),equalTo(302)); - assertThat(response.get(LOCATION),containsString("/resource/welcome.txt")); + assertThat(response.get(LOCATION),containsString("/resource/directory/welcome.txt")); } finally { From 3ee7f9fe4ad1a0965e214ee227afb5bd8453c88d Mon Sep 17 00:00:00 2001 From: WalkerWatch Date: Wed, 16 Aug 2017 17:05:37 -0400 Subject: [PATCH 04/11] Removed usages of JXURL in documentation. Also updated proxy webapp. Resolves #1747. --- jetty-distribution/pom.xml | 2 +- .../demo-base/webapps/ROOT/index.html | 3 +- .../extras/balancer-servlet.adoc | 1 - .../administration/extras/cgi-servlet.adoc | 1 - .../extras/cross-origin-filter.adoc | 1 - .../administration/extras/debug-handler.adoc | 1 - .../extras/default-handler.adoc | 1 - .../extras/default-servlet.adoc | 1 - .../administration/extras/dos-filter.adoc | 1 - .../administration/extras/error-handler.adoc | 1 - .../administration/extras/gzip-filter.adoc | 4 +- .../administration/extras/header-filter.adoc | 1 - .../extras/ipaccess-handler.adoc | 1 - .../extras/moved-context-handler.adoc | 5 +- .../administration/extras/proxy-servlet.adoc | 1 - .../administration/extras/qos-filter.adoc | 1 - .../extras/resource-handler.adoc | 1 - .../extras/rewrite-handler.adoc | 23 ++++---- .../extras/shutdown-handler.adoc | 1 - .../extras/statistics-handler.adoc | 4 +- .../deploying/static-content-deployment.adoc | 2 +- .../embedding/embedding-jetty.adoc | 34 +++++------ .../handlers/writing-custom-handlers.adoc | 4 +- .../getting-started/jetty-deploying.adoc | 26 ++++----- .../getting-started/jetty-running.adoc | 58 ++++++++++++------- .../src/main/webapp/WEB-INF/web.xml | 26 ++------- 26 files changed, 90 insertions(+), 115 deletions(-) diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index 3df837a0f44..82a37c9b588 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -192,7 +192,7 @@ true ** ${assembly-directory}/demo-base/webapps - xref-proxy.war + javadoc-proxy.war org.eclipse.jetty.example-async-rest diff --git a/jetty-distribution/src/main/resources/demo-base/webapps/ROOT/index.html b/jetty-distribution/src/main/resources/demo-base/webapps/ROOT/index.html index 5b13252f2ac..1091c20b040 100644 --- a/jetty-distribution/src/main/resources/demo-base/webapps/ROOT/index.html +++ b/jetty-distribution/src/main/resources/demo-base/webapps/ROOT/index.html @@ -45,8 +45,7 @@ diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/balancer-servlet.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/balancer-servlet.adoc index b13c049629a..873d91b2b83 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/balancer-servlet.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/balancer-servlet.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.proxy.BalancerServlet` * Maven Artifact: org.eclipse.jetty:jetty-proxy * Javadoc: {JDURL}/org/eclipse/jetty/proxy/BalancerServlet.html -* Xref: {JXURL}/org/eclipse/jetty/proxy/BalancerServlet.html [[balancer-servlet-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/cgi-servlet.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/cgi-servlet.adoc index 5a55a96c40e..ac04fcaddbc 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/cgi-servlet.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/cgi-servlet.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlets.CGI` * Maven Artifact: org.eclipse.jetty:jetty-servlets * Javadoc: {JDURL}/org/eclipse/jetty/servlets/CGI.html -* Xref: {JXURL}/org/eclipse/jetty/servlets/CGI.html [[cgi-servlet-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/cross-origin-filter.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/cross-origin-filter.adoc index 318557bc117..909706abd94 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/cross-origin-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/cross-origin-filter.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlets.CrossOriginFilter` * Maven Artifact: org.eclipse.jetty:jetty-servlets * Javadoc: {JDURL}/org/eclipse/jetty/servlets/CrossOriginFilter.html -* Xref: {JXURL}/org/eclipse/jetty/servlets/CrossOriginFilter.html [[cross-origin-filter-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/debug-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/debug-handler.adoc index b084c406c0a..4691298faf2 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/debug-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/debug-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.DebugHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/DebugHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/DebugHandler.html [[debug-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/default-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/default-handler.adoc index a0efcd49d46..1275b6ea971 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/default-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/default-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.DefaultHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/DefaultHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/DefaultHandler.html [[default-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/default-servlet.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/default-servlet.adoc index fb644447a71..cae3c2142af 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/default-servlet.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/default-servlet.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlet.DefaultServlet` * Maven Artifact: org.eclipse.jetty:jetty-servlet * Javadoc: {JDURL}/org/eclipse/jetty/servlet/DefaultServlet.html -* Xref: {JXURL}/org/eclipse/jetty/servlet/DefaultServlet.html [[default-servlet-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/dos-filter.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/dos-filter.adoc index c7ec4d36f63..ca1048f5faf 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/dos-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/dos-filter.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlets.DoSFilter` * Maven Artifact: org.eclipse.jetty:jetty-servlets * Javadoc: {JDURL}/org/eclipse/jetty/servlets/DoSFilter.html -* Xref: {JXURL}/org/eclipse/jetty/servlets/DoSFilter.html [[dos-filter-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/error-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/error-handler.adoc index 31b34b7abf7..a893b72874c 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/error-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/error-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.ErrorHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/ErrorHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/ErrorHandler.html [[error-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc index 0504905caf5..72a2a4aaf50 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc @@ -22,9 +22,7 @@ * Classname: `org.eclipse.jetty.server.handler.gzip.GzipHandler` * Maven Artifact: org.eclipse.jetty:jetty-servlets -* Javadoc: -{JDURL}/org/eclipse/jetty/server/handler/gzip/GzipHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/gzip/GzipHandler.html +* Javadoc: {JDURL}/org/eclipse/jetty/server/handler/gzip/GzipHandler.html [[gzip-filter-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/header-filter.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/header-filter.adoc index 58a08ac74ae..9b46aef157a 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/header-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/header-filter.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlets.HeaderFilter` * Maven Artifact: org.eclipse.jetty:jetty-servlets * Javadoc: {JDURL}/org/eclipse/jetty/servlets/HeaderFilter.html -* Xref: {JXURL}/org/eclipse/jetty/servlets/HeaderFilter.html [[header-filter-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/ipaccess-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/ipaccess-handler.adoc index 489f1197f4a..5ca5bf24812 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/ipaccess-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/ipaccess-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.IPAccessHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/IPAccessHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/IPAccessHandler.html [[ipaccess-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/moved-context-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/moved-context-handler.adoc index 9e498d179e5..a11af28a89c 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/moved-context-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/moved-context-handler.adoc @@ -22,10 +22,7 @@ * Classname: `org.eclipse.jetty.server.handler.MovedContextHandler` * Maven Artifact: org.eclipse.jetty:jetty-server -* Javadoc: -{JDURL}/org/eclipse/jetty/server/handler/MovedContextHandler.html -* Xref: -{JXURL}/org/eclipse/jetty/server/handler/MovedContextHandler.html +* Javadoc: {JDURL}/org/eclipse/jetty/server/handler/MovedContextHandler.html [[moved-context-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/proxy-servlet.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/proxy-servlet.adoc index b2edcdb0c9b..07421615887 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/proxy-servlet.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/proxy-servlet.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.proxy.ProxyServlet` * Maven Artifact: org.eclipse.jetty:jetty-proxy * Javadoc: {JDURL}/org/eclipse/jetty/proxy/ProxyServlet.html -* Xref: {JXURL}/org/eclipse/jetty/proxy/ProxyServlet.html [[proxy-servlet-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/qos-filter.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/qos-filter.adoc index f6f4385ea8b..8a7631d66ae 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/qos-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/qos-filter.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.servlets.QoSFilter` * Maven Artifact: org.eclipse.jetty:jetty-servlets * Javadoc: {JDURL}/org/eclipse/jetty/servlets/QoSFilter.html -* Xref: {JXURL}/org/eclipse/jetty/servlets/QoSFilter.html [[qos-filter-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/resource-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/resource-handler.adoc index 7a1de4d99bd..1407ffa02a3 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/resource-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/resource-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.ResourceHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/ResourceHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/ResourceHandler.html [[resource-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/rewrite-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/rewrite-handler.adoc index 14ff2669630..d9060158d61 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/rewrite-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/rewrite-handler.adoc @@ -26,7 +26,6 @@ The most common use is to rewrite request URIs, but it is capable of much more: * Classname: org.eclipse.jetty.rewrite.handler.RewriteHandler * Maven artifact: org.eclipse.jetty:jetty-rewrite * Javadoc: {JDURL}/org/eclipse/jetty/rewrite/handler/RewriteHandler.html -* Xref: {JXURL}/org/eclipse/jetty/rewrite/handler/RewriteHandler.html The standard Jetty distribution bundle contains the `jetty-rewrite` link:#startup-modules[module], so all you need to do is to enable it using one of the link:#start-jar[module commands], eg: @@ -98,24 +97,24 @@ There are several types of rules that are written extending useful base rule cla Matches against the request URI using the servlet pattern syntax. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/CookiePatternRule.html[CookiePatternRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/CookiePatternRule.html[CookiePatternRule]:: Adds a cookie to the response. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/HeaderPatternRule.html[HeaderPatternRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/HeaderPatternRule.html[HeaderPatternRule]:: Adds/modifies a header in the response. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/RedirectPatternRule.html[RedirectPatternRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/RedirectPatternRule.html[RedirectPatternRule]:: Redirects the response. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/ResponsePatternRule.html[ResponsePatternRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/ResponsePatternRule.html[ResponsePatternRule]:: Sends the response code (status or error). -link:{JXURL}/org/eclipse/jetty/rewrite/handler/RewritePatternRule.html[RewritePatternRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/RewritePatternRule.html[RewritePatternRule]:: Rewrite the URI by replacing the matched request path with a fixed string. ===== RegexRule Matches against the request URI using regular expressions. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/RedirectRegexRule.html[RedirectRegexRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/RedirectRegexRule.html[RedirectRegexRule]:: Redirect the response. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/RewriteRegexRule.html[RewriteRegexRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/RewriteRegexRule.html[RewriteRegexRule]:: Rewrite the URI by matching with a regular expression. (The replacement string may use `Template:$n` to replace the nth capture group.) @@ -123,16 +122,16 @@ Rewrite the URI by matching with a regular expression. Match against request headers. Match either on a header name and specific value, or on the presence of a header (with any value). -link:{JXURL}/org/eclipse/jetty/rewrite/handler/ForwardedSchemeHeaderRule.html[ForwardedSchemaHeaderRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/ForwardedSchemeHeaderRule.html[ForwardedSchemaHeaderRule]:: Set the scheme on the request (defaulting to HTTPS). ===== Others Extra rules that defy standard classification. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/MsieSslRule.html[MsieSslRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/MsieSslRule.html[MsieSslRule]:: Disables the keep alive for SSL from IE5 or IE6. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/LegacyRule.html[LegacyRule]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/LegacyRule.html[LegacyRule]:: Implements the legacy API of RewriteHandler ===== RuleContainer @@ -140,5 +139,5 @@ Implements the legacy API of RewriteHandler Groups rules together. The contained rules will only be processed if the conditions for the `RuleContainer` evaluate to true. -link:{JXURL}/org/eclipse/jetty/rewrite/handler/VirtualHostRuleContainer.html[VirtualHostRuleContainer]:: +link:{JDURL}/org/eclipse/jetty/rewrite/handler/VirtualHostRuleContainer.html[VirtualHostRuleContainer]:: Groups rules that apply only to a specific virtual host or a set of virtual hosts diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/shutdown-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/shutdown-handler.adoc index 4557f5c662c..29fdb5aeb63 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/shutdown-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/shutdown-handler.adoc @@ -23,7 +23,6 @@ * Classname: `org.eclipse.jetty.server.handler.ShutdownHandler` * Maven Artifact: org.eclipse.jetty:jetty-server * Javadoc: {JDURL}/org/eclipse/jetty/server/handler/ShutdownHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/ShutdownHandler.html [[shutdown-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/administration/extras/statistics-handler.adoc b/jetty-documentation/src/main/asciidoc/administration/extras/statistics-handler.adoc index 5a45f912411..8e6dfdcebd4 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/statistics-handler.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/statistics-handler.adoc @@ -22,9 +22,7 @@ * Classname: `org.eclipse.jetty.server.handler.StatisticsHandler` * Maven Artifact: org.eclipse.jetty:jetty-server -* Javadoc: -{JDURL}/org/eclipse/jetty/server/handler/StatisticsHandler.html -* Xref: {JXURL}/org/eclipse/jetty/server/handler/StatisticsHandler.html +* Javadoc: {JDURL}/org/eclipse/jetty/server/handler/StatisticsHandler.html [[statistics-handler-usage]] ==== Usage diff --git a/jetty-documentation/src/main/asciidoc/configuring/deploying/static-content-deployment.adoc b/jetty-documentation/src/main/asciidoc/configuring/deploying/static-content-deployment.adoc index 0dd7f7a098c..edc51d8a817 100644 --- a/jetty-documentation/src/main/asciidoc/configuring/deploying/static-content-deployment.adoc +++ b/jetty-documentation/src/main/asciidoc/configuring/deploying/static-content-deployment.adoc @@ -39,4 +39,4 @@ Create a file called `scratch.xml` in the `${jetty.base}/webapps` directory and ---- This is a very basic setup for serving static files. -For advanced static file serving, use the link:{JXURL}/org/eclipse/jetty/servlet/DefaultServlet.html[DefaultServlet]. +For advanced static file serving, use the link:{JDURL}/org/eclipse/jetty/servlet/DefaultServlet.html[DefaultServlet]. diff --git a/jetty-documentation/src/main/asciidoc/development/embedding/embedding-jetty.adoc b/jetty-documentation/src/main/asciidoc/development/embedding/embedding-jetty.adoc index d9f60a8cdc3..0b40d926182 100644 --- a/jetty-documentation/src/main/asciidoc/development/embedding/embedding-jetty.adoc +++ b/jetty-documentation/src/main/asciidoc/development/embedding/embedding-jetty.adoc @@ -87,7 +87,7 @@ One or more handlers do all request handling in Jetty. Some handlers select other specific handlers (for example, a `ContextHandlerCollection` uses the context path to select a `ContextHandler`); others use application logic to generate a response (for example, the `ServletHandler` passes the request to an application Servlet), while others do tasks unrelated to generating the response (for example, `RequestLogHandler` or `StatisticsHandler`). Later sections describe how you can combine handlers like aspects. -You can see some of the handlers available in Jetty in the link:{JXURL}/org/eclipse/jetty/server/handler/package-summary.html[org.eclipse.jetty.server.handler] package. +You can see some of the handlers available in Jetty in the link:{JDURL}/org/eclipse/jetty/server/handler/package-summary.html[org.eclipse.jetty.server.handler] package. ===== Handler Collections and Wrappers @@ -112,7 +112,7 @@ Much of the standard Servlet container in Jetty is implemented with `HandlerWrap However, because of the nature of the servlet specification, this chaining cannot be a pure nesting of handlers as the outer handlers sometimes need information that the inner handlers process. For example, when a `ContextHandler` calls some application listeners to inform them of a request entering the context, it must already know which servlet the `ServletHandler` will dispatch the request to so that the `servletPath` method returns the correct value. -The `HandlerWrapper` is specialized to the link:{JXURL}/org/eclipse/jetty/server/handler/ScopedHandler.html[`ScopedHandler`] abstract class, which supports a daisy chain of scopes. +The `HandlerWrapper` is specialized to the link:{JDURL}/org/eclipse/jetty/server/handler/ScopedHandler.html[`ScopedHandler`] abstract class, which supports a daisy chain of scopes. For example if a `ServletHandler` is nested within a `ContextHandler`, the order and nesting of execution of methods is: .... @@ -128,7 +128,7 @@ Thus when the `ContextHandler` handles the request, it does so within the scope ===== Resource Handler -The link:{JXURL}/org/eclipse/jetty/embedded/FileServer.html[FileServer example] shows how you can use a `ResourceHandler` to serve static content from the current working directory: +The link:{JDURL}/org/eclipse/jetty/embedded/FileServer.html[FileServer example] shows how you can use a `ResourceHandler` to serve static content from the current working directory: [source, java, subs="{sub-order}"] ---- @@ -144,7 +144,7 @@ However, often when embedding Jetty it is desirable to explicitly instantiate an ===== One Connector -The following example, link:{JXURL}/org/eclipse/jetty/embedded/OneConnector.html[OneConnector.java], +The following example, link:{JDURL}/org/eclipse/jetty/embedded/OneConnector.html[OneConnector.java], instantiates, configures, and adds a single HTTP connector instance to the server: [source, java, subs="{sub-order}"] @@ -152,24 +152,24 @@ instantiates, configures, and adds a single HTTP connector instance to the serve include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneConnector.java[] ---- -In this example the connector handles the HTTP protocol, as that is the default for the link:{JXURL}/org/eclipse/jetty/server/ServerConnector.html[`ServerConnector`] class. +In this example the connector handles the HTTP protocol, as that is the default for the link:{JDURL}/org/eclipse/jetty/server/ServerConnector.html[`ServerConnector`] class. ===== Many Connectors When configuring multiple connectors (for example, HTTP and HTTPS), it may be desirable to share configuration of common parameters for HTTP. To achieve this you need to explicitly configure the `ServerConnector` class with `ConnectionFactory` instances, and provide them with common HTTP configuration. -The link:{JXURL}/org/eclipse/jetty/embedded/ManyConnectors.html[ManyConnectors example], configures a server with two `ServerConnector` instances: the http connector has a link:{JXURL}/org/eclipse/jetty/server/HttpConnectionFactory.html[`HTTPConnectionFactory`] instance; the https connector has a `SslConnectionFactory` chained to a `HttpConnectionFactory`. -Both `HttpConnectionFactory` are configured based on the same link:{JXURL}/org/eclipse/jetty/server/HttpConfiguration.html[`HttpConfiguration`] instance, however the HTTPS factory uses a wrapped configuration so that a link:{JXURL}/org/eclipse/jetty/server/SecureRequestCustomizer.html[`SecureRequestCustomizer`] can be added. +The link:{JDURL}/org/eclipse/jetty/embedded/ManyConnectors.html[ManyConnectors example], configures a server with two `ServerConnector` instances: the http connector has a link:{JDURL}/org/eclipse/jetty/server/HttpConnectionFactory.html[`HTTPConnectionFactory`] instance; the https connector has a `SslConnectionFactory` chained to a `HttpConnectionFactory`. +Both `HttpConnectionFactory` are configured based on the same link:{JDURL}/org/eclipse/jetty/server/HttpConfiguration.html[`HttpConfiguration`] instance, however the HTTPS factory uses a wrapped configuration so that a link:{JDURL}/org/eclipse/jetty/server/SecureRequestCustomizer.html[`SecureRequestCustomizer`] can be added. ==== Embedding Servlets http://en.wikipedia.org/wiki/Java_Servlet[Servlets] are the standard way to provide application logic that handles HTTP requests. Servlets are similar to a Jetty Handler except that the request object is not mutable and thus cannot be modified. -Servlets are handled in Jetty by a link:{JXURL}/org/eclipse/jetty/embedded/MinimalServlets.html[`ServletHandler`]. +Servlets are handled in Jetty by a link:{JDURL}/org/eclipse/jetty/embedded/MinimalServlets.html[`ServletHandler`]. It uses standard path mappings to match a Servlet to a request; sets the requests `servletPath` and `pathInfo`; passes the request to the servlet, possibly via Filters to produce a response. -The link:{JXURL}/org/eclipse/jetty/embedded/MinimalServlets.html[MinimalServlets example] creates a `ServletHandler` instance and configures a single HelloServlet: +The link:{JDURL}/org/eclipse/jetty/embedded/MinimalServlets.html[MinimalServlets example] creates a `ServletHandler` instance and configures a single HelloServlet: [source, java, subs="{sub-order}"] ---- @@ -178,7 +178,7 @@ include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Min ==== Embedding Contexts -A link:{JXURL}/org/eclipse/jetty/embedded/OneContext.html[`ContextHandler`] is a `ScopedHandler` that responds only to requests that have a URI prefix that matches the configured context path. +A link:{JDURL}/org/eclipse/jetty/embedded/OneContext.html[`ContextHandler`] is a `ScopedHandler` that responds only to requests that have a URI prefix that matches the configured context path. Requests that match the context path have their path methods updated accordingly and the contexts scope is available, which optionally may include: * A `Classloader` that is set as the Thread context `classloader` while request handling is in scope. @@ -187,7 +187,7 @@ Requests that match the context path have their path methods updated accordingly * A base Resource which is used as the document root for static resource requests via the http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html[`ServletContext`] API. * A set of virtual host names. -The following link:{JXURL}/org/eclipse/jetty/embedded/OneContext.html[OneContext example] shows a context being established that wraps the link:{JXURL}/org/eclipse/jetty/embedded/HelloHandler.html[HelloHandler]: +The following link:{JDURL}/org/eclipse/jetty/embedded/OneContext.html[OneContext example] shows a context being established that wraps the link:{JDURL}/org/eclipse/jetty/embedded/HelloHandler.html[HelloHandler]: [source, java, subs="{sub-order}"] ---- @@ -195,7 +195,7 @@ include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/One ---- When many contexts are present, you can embed a `ContextHandlerCollection` to efficiently examine a request URI to then select the matching `ContextHandler`(s) for the request. -The link:{JXURL}/org/eclipse/jetty/embedded/ManyContexts.html[ManyContexts example] shows how many such contexts you can configure: +The link:{JDURL}/org/eclipse/jetty/embedded/ManyContexts.html[ManyContexts example] shows how many such contexts you can configure: [source, java, subs="{sub-order}"] ---- @@ -204,8 +204,8 @@ include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Man ==== Embedding ServletContexts -A link:{JXURL}/org/eclipse/jetty/servlet/ServletContextHandler.html[`ServletContextHandler`] is a specialization of `ContextHandler` with support for standard sessions and Servlets. -The following link:{JXURL}/org/eclipse/jetty/embedded/OneServletContext.html[OneServletContext example] instantiates a link:{JXURL}/org/eclipse/jetty/servlet/DefaultServlet.html[`DefaultServlet`] to server static content from /tmp/ and a `DumpServlet` that creates a session and dumps basic details about the request: +A link:{JDURL}/org/eclipse/jetty/servlet/ServletContextHandler.html[`ServletContextHandler`] is a specialization of `ContextHandler` with support for standard sessions and Servlets. +The following link:{JDURL}/org/eclipse/jetty/embedded/OneServletContext.html[OneServletContext example] instantiates a link:{JDURL}/org/eclipse/jetty/servlet/DefaultServlet.html[`DefaultServlet`] to server static content from /tmp/ and a `DumpServlet` that creates a session and dumps basic details about the request: [source, java, subs="{sub-order}"] ---- @@ -214,8 +214,8 @@ include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/One ==== Embedding Web Applications -A link:{JXURL}/org/eclipse/jetty/webapp/WebAppContext.html[`WebAppContext`] is an extension of a `ServletContextHandler` that uses the http://en.wikipedia.org/wiki/WAR_%28Sun_file_format%29[standard layout] and web.xml to configure the servlets, filters and other features from a web.xml and/or annotations. -The following link:{JXURL}/org/eclipse/jetty/embedded/OneWebApp.html[OneWebApp example] configures the Jetty test webapp. +A link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[`WebAppContext`] is an extension of a `ServletContextHandler` that uses the http://en.wikipedia.org/wiki/WAR_%28Sun_file_format%29[standard layout] and web.xml to configure the servlets, filters and other features from a web.xml and/or annotations. +The following link:{JDURL}/org/eclipse/jetty/embedded/OneWebApp.html[OneWebApp example] configures the Jetty test webapp. Web applications can use resources the container provides, and in this case a `LoginService` is needed and also configured: [source, java, subs="{sub-order}"] @@ -227,7 +227,7 @@ include::{SRCDIR}/examples/embedded/src/main/java/org/eclipse/jetty/embedded/One The typical way to configure an instance of the Jetty server is via `jetty.xml` and associated configuration files. However the Jetty XML configuration format is just a simple rendering of what you can do in code; it is very simple to write embedded code that does precisely what the jetty.xml configuration does. -The link:{JXURL}/org/eclipse/jetty/embedded/LikeJettyXml.html[LikeJettyXml example] following renders in code the behavior obtained from the configuration files: +The link:{JDURL}/org/eclipse/jetty/embedded/LikeJettyXml.html[LikeJettyXml example] following renders in code the behavior obtained from the configuration files: * link:{GITBROWSEURL}/jetty-server/src/main/config/etc/jetty.xml[jetty.xml] * link:{GITBROWSEURL}/jetty-jmx/src/main/config/etc/jetty-jmx.xml[jetty-jmx.xml] diff --git a/jetty-documentation/src/main/asciidoc/development/handlers/writing-custom-handlers.adoc b/jetty-documentation/src/main/asciidoc/development/handlers/writing-custom-handlers.adoc index 8ceff4516d2..c5238666e60 100644 --- a/jetty-documentation/src/main/asciidoc/development/handlers/writing-custom-handlers.adoc +++ b/jetty-documentation/src/main/asciidoc/development/handlers/writing-custom-handlers.adoc @@ -19,7 +19,7 @@ The Handler is the Jetty component that deals with received requests. -Many users of Jetty never need to write a Jetty Handler, but instead use the link:{JXURL}/org/eclipse/jetty/servlet/package-summary.html[Servlet API.] +Many users of Jetty never need to write a Jetty Handler, but instead use the link:{JDURL}/org/eclipse/jetty/servlet/package-summary.html[Servlet API.] You can reuse the existing Jetty handlers for context, security, sessions and servlets without the need for extension. However, some users might have special requirements or footprint concerns that prohibit the use of the full servlet API. For them implementing a Jetty handler is a straight forward way to provide dynamic web content with a minimum of fuss. @@ -171,4 +171,4 @@ This is typically used to pass a request to a link:{JDURL}/org/eclipse/jetty/ser [[more-about-handlers]] ==== More About Handlers -See the link:{JXURL}/[latest Jetty Source XRef] and the link:{JDURL}/[latest Jetty JavaDoc] for detailed information on each Jetty handler. +See the link:{JDURL}/[latest Jetty JavaDoc] for detailed information on each Jetty handler. diff --git a/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-deploying.adoc b/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-deploying.adoc index 08887257236..def928e5061 100644 --- a/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-deploying.adoc +++ b/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-deploying.adoc @@ -17,18 +17,18 @@ [[quickstart-deploying-webapps]] === Deploying Web Applications -Jetty server instances that configure the deploy module will have a web application deployer that link:#hot-deployment[hot deploys] files found in the `webapps` directory. +Jetty server instances that configure the deploy module will have a web application deployer that link:#hot-deployment[hot deploys] files found in the `webapps` directory. Standard WAR files and Jetty configuration files that are placed in the `webapps` directory are hot deployed to the server with the following conventions: -* A directory called `example/` is deployed as a standard web application if it contains a `WEB-INF/` subdirectory, otherwise it is deployed as context of static content. -The context path is `/example` (that is, `http://localhost:8080/example/`) unless the base name is ROOT (case insensitive), in which case the context path is /. +* A directory called `example/` is deployed as a standard web application if it contains a `WEB-INF/` subdirectory, otherwise it is deployed as context of static content. +The context path is `/example` (that is, `http://localhost:8080/example/`) unless the base name is ROOT (case insensitive), in which case the context path is /. If the directory name ends with ".d" it is ignored (but may be used by explicit configuration). * A file called `example.war` is deployed as a standard web application with the context path `/example` (that is, -`http://localhost:8080/example/`). -If the base name is `ROOT` (case insensitive), the context path is `/`. +`http://localhost:8080/example/`). +If the base name is `ROOT` (case insensitive), the context path is `/`. If `example.war` and `example/` exist, only the WAR is deployed (which may use the directory as an unpack location). -* An XML file like `example.xml` is deployed as a context whose configuration is defined by the XML. -The configuration itself must set the context path. +* An XML file like `example.xml` is deployed as a context whose configuration is defined by the XML. +The configuration itself must set the context path. If `example.xml` and `example.war` exists, only the XML is deployed (which may use the WAR in its configuration). If you have a standard web application, you can hot deploy it into Jetty by copying it into the `webapps` directory. @@ -38,10 +38,10 @@ If you have a standard web application, you can hot deploy it into Jetty by copy The demo-base/webapps directory contains the following deployable and auxiliary files: `ROOT/`:: - A directory of static content that is deployed to the root context / due to it's name. + A directory of static content that is deployed to the root context / due to it's name. Contains the Jetty demo welcome page. `test.d`:: - A directory containing additional configuration files used by `test.xml` to inject extra configuration into `test.war`. + A directory containing additional configuration files used by `test.xml` to inject extra configuration into `test.war`. `test.xml`:: A context configuration file that configures and deploys `test.war.` The additional configuration includes the context path as well as setting additional descriptors found in the `test.d` directory. @@ -57,14 +57,14 @@ The demo-base/webapps directory contains the following deployable and auxiliary `test-jndi.war`:: A demonstration web application showing the use of link:#jndi[JNDI]. `test-jndi.xml`:: - A context configuration file that configures `test-jndi.war`. + A context configuration file that configures `test-jndi.war`. Additional configuration includes defining objects in the naming space that can be referenced from the webapp. `test-spec.war`:: A demonstration web application that shows the use of annotations, fragments, `ServletContainerInitializers` and other Servlet Specification 3.0/3.1 features. `test-spec.xml`:: - A context configuration file that configures `test-spec.war`. + A context configuration file that configures `test-spec.war`. Additional configuration includes setting up some objects in the naming space that can be referenced by annotations. -`xref-proxy.war`:: - A demonstration web application that uses a transparent proxy to serve the Jetty source link:{JXURL}/[xref] from the http://www.eclipse.org/jetty[Eclipse Jetty website]. +`javadoc-proxy.war`:: + A demonstration web application that uses a transparent proxy to serve the Jetty source link:{JDURL}/[Javadoc] from the http://www.eclipse.org/jetty[Eclipse Jetty website]. `example-moved.xml`:: A demonstration context configuration file that shows how to use the link:#moved-context-handler[`MovedContextHandler`] to redirect from one path to another. diff --git a/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-running.adoc b/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-running.adoc index 1572a269bc2..99694c15ef0 100644 --- a/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-running.adoc +++ b/jetty-documentation/src/main/asciidoc/quick-start/getting-started/jetty-running.adoc @@ -55,27 +55,43 @@ Within the standard Jetty distribution there is the `demo-base` directory, which > cd $JETTY_HOME/demo-base/ > java -jar $JETTY_HOME/start.jar -2015-06-04 10:55:24.161:INFO::main: Logging initialized @308ms -2015-06-04 10:55:24.431:WARN::main: demo test-realm is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:24.434:INFO:oejs.Server:main: jetty-9.3.0.v20150601 -2015-06-04 10:55:24.457:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///opt/jetty-distribution-9.3.0.v20150601/demo-base/webapps/] at interval 1 -2015-06-04 10:55:24.826:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@c038203{/,file:///opt/jetty-distribution-9.3.0.v20150601/demo-base/webapps/ROOT/,AVAILABLE}{/ROOT} -2015-06-04 10:55:24.929:WARN::main: test-jaas webapp is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:24.978:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@46238e3f{/test-jaas,file:///tmp/jetty-0.0.0.0-8080-test-jaas.war-_test-jaas-any-9105214562680121772.dir/webapp/,AVAILABLE}{/test-jaas.war} -2015-06-04 10:55:25.162:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:25.208:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@6b67034{/async-rest,[file:///tmp/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-1023939491558622183.dir/webapp/, jar:file:///tmp/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-1023939491558622183.dir/webapp/WEB-INF/lib/example-async-rest-jar-9.3.0.v20150601.jar!/META-INF/resources],AVAILABLE}{/async-rest.war} -2015-06-04 10:55:25.311:WARN::main: test-jndi webapp is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:25.386:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@8b96fde{/test-jndi,file:///tmp/jetty-0.0.0.0-8080-test-jndi.war-_test-jndi-any-1692053319754270133.dir/webapp/,AVAILABLE}{/test-jndi.war} -2015-06-04 10:55:25.508:WARN::main: test-spec webapp is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:25.594:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@69930714{/test-spec,[file:///tmp/jetty-0.0.0.0-8080-test-spec.war-_test-spec-any-5518740932795802823.dir/webapp/, jar:file:///tmp/jetty-0.0.0.0-8080-test-spec.war-_test-spec-any-5518740932795802823.dir/webapp/WEB-INF/lib/test-web-fragment-9.3.0.v20150601.jar!/META-INF/resources],AVAILABLE}{/test-spec.war} -2015-06-04 10:55:25.781:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@3eb7fc54{/proxy,file:///tmp/jetty-0.0.0.0-8080-xref-proxy.war-_xref-proxy-any-3068657547009829038.dir/webapp/,AVAILABLE}{/xref-proxy.war} -2015-06-04 10:55:25.786:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.MovedContextHandler@59662a0b{/oldContextPath,null,AVAILABLE} -2015-06-04 10:55:25.951:WARN::main: test webapp is deployed. DO NOT USE IN PRODUCTION! -2015-06-04 10:55:26.248:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@4f83df68{/test,file:///tmp/jetty-0.0.0.0-8080-test.war-_test-any-5238659347611323540.dir/webapp/,AVAILABLE}{/test.war} -2015-06-04 10:55:26.255:INFO:oejs.ServerConnector:main: Started ServerConnector@5a9c4ad9{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} -2015-06-04 10:55:26.259:INFO:oejus.SslContextFactory:main: x509={jetty.eclipse.org=jetty} wild={} alias=null for SslContextFactory@23941fb4(file:///opt/jetty-distribution-9.3.0.v20150601/demo-base/etc/keystore,file:///opt/jetty-distribution-9.3.0.v20150601/demo-base/etc/keystore) -2015-06-04 10:55:26.269:INFO:oejs.ServerConnector:main: Started ServerConnector@5d908d47{SSL,[ssl, http/1.1]}{0.0.0.0:8443} -2015-06-04 10:55:26.270:INFO:oejs.Server:main: Started @2417ms +2017-08-16 16:55:15.571:INFO::main: Logging initialized @521ms to org.eclipse.jetty.util.log.StdErrLog +2017-08-16 16:55:15.907:WARN::main: demo test-realm is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:15.910:INFO:oejs.Server:main: jetty-9.4.7-SNAPSHOT +2017-08-16 16:55:15.931:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/webapps/] at interval 1 +2017-08-16 16:55:16.151:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=50ms +2017-08-16 16:55:16.369:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0 +2017-08-16 16:55:16.369:INFO:oejs.session:main: No SessionScavenger set, using defaults +2017-08-16 16:55:16.370:INFO:oejs.session:main: Scavenging every 660000ms +2017-08-16 16:55:16.416:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@7113b13f{/,file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/webapps/ROOT/,AVAILABLE}{/ROOT} +2017-08-16 16:55:16.625:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=82ms +2017-08-16 16:55:16.631:WARN::main: test webapp is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:16.751:INFO:oejsh.ManagedAttributeListener:main: update PushFilter null->org.eclipse.jetty.servlets.PushCacheFilter@1a677343 on o.e.j.w.WebAppContext@2d7275fc{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-7157753932050220016.dir/webapp/,STARTING}{/test.war} +2017-08-16 16:55:16.757:INFO:oejsh.ManagedAttributeListener:main: update QoSFilter null->org.eclipse.jetty.servlets.QoSFilter@79079097 on o.e.j.w.WebAppContext@2d7275fc{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-7157753932050220016.dir/webapp/,STARTING}{/test.war} +2017-08-16 16:55:16.760:WARN:oeju.DeprecationWarning:main: Using @Deprecated Class org.eclipse.jetty.servlets.MultiPartFilter +2017-08-16 16:55:16.809:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@2d7275fc{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-7157753932050220016.dir/webapp/,AVAILABLE}{/test.war} +2017-08-16 16:55:16.816:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.MovedContextHandler@7c9d8e2{/oldContextPath,null,AVAILABLE} +2017-08-16 16:55:16.854:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=23ms +2017-08-16 16:55:16.891:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@69453e37{/doc,file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/webapps/doc/,AVAILABLE}{/doc} +2017-08-16 16:55:16.942:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=25ms +2017-08-16 16:55:16.945:WARN::main: test-jaas webapp is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:16.983:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@4e3958e7{/test-jaas,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test-jaas.war-_test-jaas-any-6953571893682159674.dir/webapp/,AVAILABLE}{/test-jaas.war} +2017-08-16 16:55:17.106:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=21ms +2017-08-16 16:55:17.109:WARN::main: test-jndi webapp is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:17.192:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@1d8bd0de{/test-jndi,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test-jndi.war-_test-jndi-any-1246461885510956986.dir/webapp/,AVAILABLE}{/test-jndi.war} +2017-08-16 16:55:17.307:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=53ms +2017-08-16 16:55:17.310:WARN::main: test-spec webapp is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:17.388:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@51dcb805{/test-spec,[file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test-spec.war-_test-spec-any-3750193079644252256.dir/webapp/, jar:file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test-spec.war-_test-spec-any-3750193079644252256.dir/webapp/WEB-INF/lib/test-web-fragment-9.4.7-SNAPSHOT.jar!/META-INF/resources],AVAILABLE}{/test-spec.war} +2017-08-16 16:55:17.490:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=53ms +2017-08-16 16:55:17.493:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION! +2017-08-16 16:55:17.516:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@1de76cc7{/async-rest,[file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-8972552397332323832.dir/webapp/, jar:file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-8972552397332323832.dir/webapp/WEB-INF/lib/example-async-rest-jar-9.4.7-SNAPSHOT.jar!/META-INF/resources],AVAILABLE}{/async-rest.war} +2017-08-16 16:55:17.643:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=83ms +2017-08-16 16:55:17.921:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@242b836{/proxy,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-javadoc-proxy.war-_javadoc-proxy-any-4521643038409884891.dir/webapp/,AVAILABLE}{/javadoc-proxy.war} +2017-08-16 16:55:17.936:INFO:oejs.AbstractConnector:main: Started ServerConnector@6f15d60e{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} +2017-08-16 16:55:17.944:INFO:oejus.SslContextFactory:main: x509=X509@58e1d9d(jetty,h=[jetty.eclipse.org],w=[]) for SslContextFactory@446a1e84(file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/etc/keystore,file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/etc/keystore) +2017-08-16 16:55:17.944:INFO:oejus.SslContextFactory:main: x509=X509@4f0f2942(mykey,h=[],w=[]) for SslContextFactory@446a1e84(file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/etc/keystore,file:///tmp/jetty-distribution-9.4.7-SNAPSHOT/demo-base/etc/keystore) +2017-08-16 16:55:18.071:INFO:oejs.AbstractConnector:main: Started ServerConnector@41488b16{SSL,[ssl, http/1.1]}{0.0.0.0:8443} +2017-08-16 16:55:18.072:INFO:oejs.Server:main: Started @3022ms ---- You can visit this demo server by pointing a browser at link:http://localhost:8080[], which will now show a welcome page and several demo/test web applications. diff --git a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml index 5cfa55da11a..e136c519b55 100644 --- a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml @@ -7,33 +7,15 @@ version="3.0"> Transparent Proxy WebApp - - - XrefTransparentProxy - org.eclipse.jetty.proxy.ProxyServlet$Transparent - - proxyTohttp://download.eclipse.org/jetty/stable-9 - - - hostHeaderdownload.eclipse.org - - 1 - true - - - - XrefTransparentProxy - /xref/* - - + JavadocTransparentProxy org.eclipse.jetty.proxy.ProxyServlet$Transparent - proxyTohttp://download.eclipse.org/jetty/stable-9 + proxyTohttp://www.eclipse.org/jetty/javadoc/ - hostHeaderdownload.eclipse.org + hostHeadereclipse.org 1 true @@ -41,7 +23,7 @@ JavadocTransparentProxy - /apidocs/* + /current/* From 2bfe6fa964a917c781127fb36f54536ea51ea562 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 17 Aug 2017 11:15:00 +0200 Subject: [PATCH 05/11] Fixes #1749 - Dump HttpDestination exchange queue. --- .../main/java/org/eclipse/jetty/client/HttpDestination.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index 5a21aec22b1..42238b77fbd 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -22,6 +22,7 @@ import java.io.Closeable; import java.io.IOException; import java.nio.channels.AsynchronousCloseException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Queue; import java.util.concurrent.RejectedExecutionException; @@ -40,6 +41,7 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; +import org.eclipse.jetty.util.component.DumpableCollection; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -275,7 +277,8 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest @Override public void dump(Appendable out, String indent) throws IOException { - ContainerLifeCycle.dumpObject(out, toString()); + ContainerLifeCycle.dumpObject(out, this); + ContainerLifeCycle.dump(out, indent, Collections.singleton(new DumpableCollection("exchanges", exchanges))); } public String asString() From c395097812c7de76599025844831b201bc4b2d29 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 17 Aug 2017 11:42:27 +0200 Subject: [PATCH 06/11] Fixes #1749 - Dump HttpDestination exchange queue. Improved code. --- .../java/org/eclipse/jetty/client/HttpDestination.java | 8 +------- .../org/eclipse/jetty/client/PoolingHttpDestination.java | 7 ------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index 42238b77fbd..da21c0c02d1 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -268,16 +268,10 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest exchange.getRequest().abort(cause); } - @Override - public String dump() - { - return ContainerLifeCycle.dump(this); - } - @Override public void dump(Appendable out, String indent) throws IOException { - ContainerLifeCycle.dumpObject(out, this); + super.dump(out, indent); ContainerLifeCycle.dump(out, indent, Collections.singleton(new DumpableCollection("exchanges", exchanges))); } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java index 3064e423729..e15d0e38a14 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java @@ -249,13 +249,6 @@ public abstract class PoolingHttpDestination extends HttpD connectionPool.close(); } - @Override - public void dump(Appendable out, String indent) throws IOException - { - super.dump(out, indent); - ContainerLifeCycle.dump(out, indent, Collections.singletonList(connectionPool)); - } - @Override public String toString() { From bcf96517bd74c82e821e5ef20b9ce33ebf78db55 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 17 Aug 2017 11:42:56 +0200 Subject: [PATCH 07/11] Fixes #1750 - PoolingHttpDestination creates ConnectionPool twice. --- .../org/eclipse/jetty/client/PoolingHttpDestination.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java index e15d0e38a14..582f47dd138 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java @@ -18,15 +18,11 @@ package org.eclipse.jetty.client; -import java.io.IOException; -import java.util.Collections; - import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.thread.Sweeper; @ManagedObject @@ -37,11 +33,6 @@ public abstract class PoolingHttpDestination extends HttpD public PoolingHttpDestination(HttpClient client, Origin origin) { super(client, origin); - this.connectionPool = newConnectionPool(client); - addBean(connectionPool); - Sweeper sweeper = client.getBean(Sweeper.class); - if (sweeper != null) - sweeper.offer(connectionPool); } @Override From 7390707e07c8713c39d2cfb6c98e79841b033670 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 17 Aug 2017 16:37:13 +0200 Subject: [PATCH 08/11] Fixes #1750 - PoolingHttpDestination creates ConnectionPool twice. Now destinations needs to be started in tests. --- .../jetty/client/http/HttpDestinationOverHTTPTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java index 9f1cd0d9b2c..791d56d23bb 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java @@ -59,6 +59,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_FirstAcquire_WithEmptyQueue() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection = destination.acquire(); if (connection == null) { @@ -72,6 +73,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_SecondAcquire_AfterFirstAcquire_WithEmptyQueue_ReturnsSameConnection() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection1 = destination.acquire(); if (connection1 == null) { @@ -118,6 +120,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest }; } }; + destination.start(); Connection connection1 = destination.acquire(); // Make sure we entered idleCreated(). @@ -145,6 +148,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_Acquire_Process_Release_Acquire_ReturnsSameConnection() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); HttpConnectionOverHTTP connection1 = destination.acquire(); long start = System.nanoTime(); @@ -172,6 +176,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest client.setIdleTimeout(idleTimeout); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection1 = destination.acquire(); if (connection1 == null) { From 643c3175a012170f6cc6aed37bd9fd30951dca02 Mon Sep 17 00:00:00 2001 From: WalkerWatch Date: Thu, 17 Aug 2017 15:03:46 -0400 Subject: [PATCH 09/11] Updating to reflect changes to Eclipse Contributor Agreement. --- CONTRIBUTING.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90a9c7039dc..9f910272997 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ Contributing to Jetty ===================== -Thanks for your interest in this project. +Thank you for your interest in this project! Project description -------------------- Jetty is a lightweight highly scalable java based web server and servlet engine. Our goal is to support web protocols like HTTP, HTTP/2, and WebSocket in a high -volume low latency way that provides maximum performance while retaining the ease +volume, low latency way that provides maximum performance while retaining the ease of use and compatibility with years of servlet development. Jetty is a modern fully async web server that has a long history as a component oriented technology easily embedded into applications while still offering a solid @@ -20,18 +20,17 @@ Information regarding source code management, builds, coding standards, and more - [https://www.eclipse.org/jetty/documentation/current/advanced-contributing.html](https://www.eclipse.org/jetty/documentation/current/advanced-contributing.html) -The canonical Jetty git repository is located at GitHub. Providing you have +The canonical Jetty git repository is located at [GitHub.](https://github.com/eclipse/jetty.project) Providing you have completed the contributors agreement mentioned below we will endeavor to pull your commit into Jetty proper. -Contributor License Agreement +Eclipse Contributor Agreement ------------------------------ -Before your contribution can be accepted by the project, you need to create and electronically sign the -Eclipse Foundation [Contributor License Agreement](https://www.eclipse.org/legal/CLA.php) (CLA): +Before your contribution can be accepted by the project, you need to create and electronically sign a [Eclipse Contributor Agreement (ECA)](http://www.eclipse.org/legal/ecafaq.php): -1. Log in to the [Eclipse projects forge](https://projects.eclipse.org/user/login/sso). You will need to +1. Log in to the [Eclipse foundation website](https://accounts.eclipse.org/user/login/). You will need to create an account with the Eclipse Foundation if you have not already done so. -2. Click on "Contributor License Agreement", and complete the form. +2. Click on "Eclipse ECA", and complete the form. Be sure to use the same email address in your Eclipse account that you intend to use when you commit to Git. From a7e8b4220a410b85c843bffcd13f07d70f1b3fe8 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 18 Aug 2017 11:38:55 +1000 Subject: [PATCH 10/11] Issue #1556 Timing attack --- .../jetty/util/security/Credential.java | 52 +++++++++---------- .../jetty/util/security/CredentialTest.java | 18 +++++++ 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java index e843281d83f..7815ce9d39b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java @@ -86,51 +86,47 @@ public abstract class Credential implements Serializable } /** - *

Utility method that replaces String.equals() to avoid timing attacks.

+ *

Utility method that replaces String.equals() to avoid timing attacks. + * The length of the loop executed will always be the length of the unknown credential

* - * @param s1 the first string to compare - * @param s2 the second string to compare + * @param known the first string to compare (should be known string) + * @param unknown the second string to compare (should be the unknown string) * @return whether the two strings are equal */ - protected static boolean stringEquals(String s1, String s2) + protected static boolean stringEquals(String known, String unknown) { - if (s1 == s2) + if (known == unknown) return true; - if (s1 == null || s2 == null) + if (known == null || unknown == null) return false; boolean result = true; - int l1 = s1.length(); - int l2 = s2.length(); - if (l1 != l2) - result = false; - int l = Math.min(l1, l2); - for (int i = 0; i < l; ++i) - result &= s1.charAt(i) == s2.charAt(i); - return result; + int l1 = known.length(); + int l2 = unknown.length(); + for (int i = 0; i < l2; ++i) + result &= known.charAt(i%l1) == unknown.charAt(i); + return result && l1 == l2; } /** - *

Utility method that replaces Arrays.equals() to avoid timing attacks.

+ *

Utility method that replaces Arrays.equals() to avoid timing attacks. + * The length of the loop executed will always be the length of the unknown credential

* - * @param b1 the first byte array to compare - * @param b2 the second byte array to compare + * @param known the first byte array to compare (should be known value) + * @param unknown the second byte array to compare (should be unknown value) * @return whether the two byte arrays are equal */ - protected static boolean byteEquals(byte[] b1, byte[] b2) + protected static boolean byteEquals(byte[] known, byte[] unknown) { - if (b1 == b2) + if (known == unknown) return true; - if (b1 == null || b2 == null) + if (known == null || unknown == null) return false; boolean result = true; - int l1 = b1.length; - int l2 = b2.length; - if (l1 != l2) - result = false; - int l = Math.min(l1, l2); - for (int i = 0; i < l; ++i) - result &= b1[i] == b2[i]; - return result; + int l1 = known.length; + int l2 = unknown.length; + for (int i = 0; i < l2; ++i) + result &= known[i%l1] == unknown[i]; + return result && l1 == l2; } /** diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/security/CredentialTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/security/CredentialTest.java index 248dfce5fbc..fbdd19c71af 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/security/CredentialTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/security/CredentialTest.java @@ -76,4 +76,22 @@ public class CredentialTest assertTrue (p1.equals(p2)); } + + @Test + public void testStringEquals() + { + assertTrue(Credential.stringEquals("foo","foo")); + assertFalse(Credential.stringEquals("foo","fooo")); + assertFalse(Credential.stringEquals("foo","fo")); + assertFalse(Credential.stringEquals("foo","bar")); + } + + @Test + public void testBytesEquals() + { + assertTrue(Credential.byteEquals("foo".getBytes(),"foo".getBytes())); + assertFalse(Credential.byteEquals("foo".getBytes(),"fooo".getBytes())); + assertFalse(Credential.byteEquals("foo".getBytes(),"fo".getBytes())); + assertFalse(Credential.byteEquals("foo".getBytes(),"bar".getBytes())); + } } From 6c44538bb6dcd22a30b1f2bae2b9290d0b2d6929 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 18 Aug 2017 19:36:27 +0200 Subject: [PATCH 11/11] Fixes #1750 - PoolingHttpDestination creates ConnectionPool twice. Now destinations needs to be started in tests, take 2. --- .../jetty/client/http/HttpReceiverOverHTTPTest.java | 1 + .../eclipse/jetty/client/http/HttpSenderOverHTTPTest.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java index 693f5af5f84..3c88cd5faca 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java @@ -60,6 +60,7 @@ public class HttpReceiverOverHTTPTest client = new HttpClient(); client.start(); destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); endPoint = new ByteArrayEndPoint(); connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter<>()); endPoint.setConnection(connection); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java index 9bd06e305ed..a2598ad818a 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java @@ -67,6 +67,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); final CountDownLatch headersLatch = new CountDownLatch(1); @@ -100,6 +101,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint("", 16); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); connection.send(request, null); @@ -129,6 +131,7 @@ public class HttpSenderOverHTTPTest // Shutdown output to trigger the exception on write endPoint.shutdownOutput(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); final CountDownLatch failureLatch = new CountDownLatch(2); @@ -158,6 +161,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint("", 16); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); final CountDownLatch failureLatch = new CountDownLatch(2); @@ -193,6 +197,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); String content = "abcdef"; @@ -227,6 +232,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); String content1 = "0123456789"; @@ -262,6 +268,7 @@ public class HttpSenderOverHTTPTest { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); + destination.start(); HttpConnectionOverHTTP connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter()); Request request = client.newRequest(URI.create("http://localhost/")); String content1 = "0123456789";