From b889d2d3003b760dcb90088f563c9818b178b632 Mon Sep 17 00:00:00 2001 From: WalkerWatch Date: Mon, 25 Sep 2017 14:54:19 -0400 Subject: [PATCH 1/3] Fixing JXURL usage and updating proxy webapp as in #1747. Resolves #1844. --- 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 | 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 +- .../configuring/security/jaas-support.adoc | 8 ++-- .../embedding/embedding-jetty.adoc | 34 +++++++------- .../handlers/writing-custom-handlers.adoc | 4 +- .../getting-started/jetty-deploying.adoc | 2 +- .../src/main/webapp/WEB-INF/web.xml | 44 +++++-------------- 25 files changed, 52 insertions(+), 93 deletions(-) diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index b659b6197ee..b0b23dcf9b9 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -157,7 +157,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..002fec3cae2 100644 --- a/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/extras/gzip-filter.adoc @@ -24,7 +24,6 @@ * 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 [[gzip-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 313c5538345..84762a454ef 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 19615409c09..db1ca7f4572 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 4461e6ccc43..6f56bca934d 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/configuring/security/jaas-support.adoc b/jetty-documentation/src/main/asciidoc/configuring/security/jaas-support.adoc index 7bfb90e4ba8..da949f3688f 100644 --- a/jetty-documentation/src/main/asciidoc/configuring/security/jaas-support.adoc +++ b/jetty-documentation/src/main/asciidoc/configuring/security/jaas-support.adoc @@ -226,10 +226,10 @@ As `LoginModules` are free to use their own implementation of the JAAS Principal ===== Sample LoginModules -* link:{JXURL}/org/eclipse/jetty/jaas/spi/JDBCLoginModule.html[`org.eclipse.jetty.jaas.spi.JDBCLoginModule`] -* link:{JXURL}/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.html[`org.eclipse.jetty.jaas.spi.PropertyFileLoginModule`] -* link:{JXURL}/org/eclipse/jetty/jaas/spi/DataSourceLoginModule.html[`org.eclipse.jetty.jaas.spi.DataSourceLoginModule`] -* link:{JXURL}/org/eclipse/jetty/jaas/spi/LdapLoginModule.html[`org.eclipse.jetty.jaas.ldap.LdapLoginModule`] +* link:{JDURL}/org/eclipse/jetty/jaas/spi/JDBCLoginModule.html[`org.eclipse.jetty.jaas.spi.JDBCLoginModule`] +* link:{JDURL}/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.html[`org.eclipse.jetty.jaas.spi.PropertyFileLoginModule`] +* link:{JDURL}/org/eclipse/jetty/jaas/spi/DataSourceLoginModule.html[`org.eclipse.jetty.jaas.spi.DataSourceLoginModule`] +* link:{JDURL}/org/eclipse/jetty/jaas/spi/LdapLoginModule.html[`org.eclipse.jetty.jaas.ldap.LdapLoginModule`] ____ [NOTE] 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..1fc7b2418a3 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 Source XRef] and 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..19167c778b2 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 @@ -65,6 +65,6 @@ The demo-base/webapps directory contains the following deployable and auxiliary 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]. + A demonstration web application that uses a transparent proxy to serve the Jetty source link:{JDURL}/[xref] 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/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..52ae8850626 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 @@ -1,49 +1,29 @@ - + 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 - + JavadocTransparentProxy - /apidocs/* + /current/* - - - + \ No newline at end of file From 44e1b7b02b1b3950c81fb3f602bb2ae017deabdc Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Tue, 26 Sep 2017 10:25:50 +1000 Subject: [PATCH 2/3] upgrade versions-maven-plugin version to 2.5 to avoid manual update of the bom file Signed-off-by: olivier lamy --- scripts/release-jetty.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/release-jetty.sh b/scripts/release-jetty.sh index 7cd0cfe2f9f..a9f7f5ea6b9 100755 --- a/scripts/release-jetty.sh +++ b/scripts/release-jetty.sh @@ -141,9 +141,10 @@ if proceedyn "Are you sure you want to release using above? (y/N)" n; then # This is equivalent to 'mvn release:prepare' if proceedyn "Update project.versions for $VER_RELEASE? (Y/n)" y; then - mvn org.codehaus.mojo:versions-maven-plugin:2.1:set \ + mvn org.codehaus.mojo:versions-maven-plugin:2.5:set \ -DoldVersion="$VER_CURRENT" \ - -DnewVersion="$VER_RELEASE" + -DnewVersion="$VER_RELEASE" \ + -DprocessAllModules=true fi if proceedyn "Commit $VER_RELEASE updates? (Y/n)" y; then git commit -a -m "Updating to version $VER_RELEASE" From 52baec434b3712f81b607bfde014ddfae19e1bb4 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 17 Oct 2017 14:04:53 +1100 Subject: [PATCH 3/3] Test #1898 --- .../org/eclipse/jetty/server/RequestTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index 39a617c9cd7..2715829accb 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -100,6 +100,7 @@ public class RequestTest _server.setHandler(_handler); ErrorHandler errors = new ErrorHandler(); + errors.setServer(_server); errors.setShowStacks(true); _server.addBean(errors); _server.start(); @@ -1382,6 +1383,42 @@ public class RequestTest assertEquals("14316.133020.1.1.utr=gna.de|ucn=(real)|utd=reral|utct=/games/hen-one,gnt-50-ba-keys:key,2072262.html", cookies.get(0).getValue()); } + + @Test + public void testBadCookies() throws Exception + { + final ArrayList cookies = new ArrayList<>(); + + _handler._checker = new RequestTester() + { + @Override + public boolean check(HttpServletRequest request,HttpServletResponse response) throws IOException + { + javax.servlet.http.Cookie[] ca = request.getCookies(); + if (ca!=null) + cookies.addAll(Arrays.asList(ca)); + response.getOutputStream().println("Hello World"); + return true; + } + }; + + String response; + + cookies.clear(); + response=_connector.getResponses( + "GET / HTTP/1.1\n"+ + "Host: whatever\n"+ + "Cookie: path=value\n" + + "Cookie: name=value\n" + + "Connection: close\n"+ + "\n" + ); + assertTrue(response.startsWith("HTTP/1.1 200 OK")); + assertEquals(1,cookies.size()); + assertEquals("name", cookies.get(0).getName()); + assertEquals("value", cookies.get(0).getValue()); + + } @Ignore("No longer relevant") @Test