From 5a2a9790e5adbf17afcf3a788b9cb56071845883 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Wed, 16 Dec 2020 15:48:44 +0100 Subject: [PATCH 1/2] final 10 chapters with appendix-properties adjusted Signed-off-by: Maxim Nesen --- docs/src/main/docbook/appendix-properties.xml | 131 +- docs/src/main/docbook/cdi.xml | 2 +- docs/src/main/docbook/custom-di.xml | 30 +- docs/src/main/docbook/how-to-build.xml | 18 +- docs/src/main/docbook/jersey.ent | 39 +- docs/src/main/docbook/logging.xml | 11 +- docs/src/main/docbook/mbw.xml | 2 +- docs/src/main/docbook/migration.xml | 2222 +---------------- docs/src/main/docbook/monitoring.xml | 18 +- docs/src/main/docbook/mvc.xml | 15 +- docs/src/main/docbook/security.xml | 29 +- docs/src/main/docbook/test-framework.xml | 7 +- docs/src/main/docbook/user-guide.xml | 2 +- docs/src/main/docbook/wadl.xml | 16 +- 14 files changed, 236 insertions(+), 2306 deletions(-) diff --git a/docs/src/main/docbook/appendix-properties.xml b/docs/src/main/docbook/appendix-properties.xml index 4cb7c85869..7eb6347ed9 100644 --- a/docs/src/main/docbook/appendix-properties.xml +++ b/docs/src/main/docbook/appendix-properties.xml @@ -49,8 +49,22 @@ - &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE; - jersey.config.disableAutoDiscovery + &jersey.common.CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER; + jersey.config.allowSystemPropertiesProvider + + + Property which allows (if true) default System properties configuration provider. + Default value is true. + + + + + &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE; / + &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE_CLIENT; / + &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE_SERVER; + jersey.config.disableAutoDiscovery/ + jersey.config.client.disableAutoDiscovery/ + jersey.config.server.disableAutoDiscovery Disables feature auto discovery globally on client/server. Default value is false. @@ -58,8 +72,12 @@ - &jersey.common.CommonProperties.JSON_PROCESSING_FEATURE_DISABLE; - jersey.config.disableJsonProcessing + &jersey.common.CommonProperties.JSON_PROCESSING_FEATURE_DISABLE; / + &jersey.common.CommonProperties.JSON_PROCESSING_FEATURE_DISABLE_CLIENT; / + &jersey.common.CommonProperties.JSON_PROCESSING_FEATURE_DISABLE_SERVER; + jersey.config.disableJsonProcessing / + jersey.config.client.disableJsonProcessing / + jersey.config.server.disableJsonProcessing Disables configuration of Json Processing (JSR-353) feature. Default value is false. @@ -67,8 +85,12 @@ - &jersey.common.CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE; - jersey.config.disableMetainfServicesLookup + &jersey.common.CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE; / + &jersey.common.CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE_CLIENT; / + &jersey.common.CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE_SERVER; + jersey.config.disableMetainfServicesLookup / + jersey.config.client.disableMetainfServicesLookup / + jersey.config.server.disableMetainfServicesLookup Disables META-INF/services lookup globally on client/server. Default value is false. @@ -76,8 +98,12 @@ - &jersey.common.CommonProperties.MOXY_JSON_FEATURE_DISABLE; - jersey.config.disableMoxyJson + &jersey.common.CommonProperties.MOXY_JSON_FEATURE_DISABLE; / + &jersey.common.CommonProperties.MOXY_JSON_FEATURE_DISABLE_CLIENT; / + &jersey.common.CommonProperties.MOXY_JSON_FEATURE_DISABLE_SERVER; + jersey.config.disableMoxyJson / + jersey.config.client.disableMoxyJson / + jersey.config.server.disableMoxyJson Disables configuration of MOXy Json feature. Default value is false. @@ -85,8 +111,12 @@ - &jersey.common.CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER; - jersey.config.contentLength.buffer + &jersey.common.CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER; / + &jersey.common.CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT; / + &jersey.common.CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER; + jersey.config.contentLength.buffer / + jersey.config.client.contentLength.buffer / + jersey.config.server.contentLength.buffer An integer value that defines the buffer size used to buffer the outbound message entity in order to @@ -95,6 +125,28 @@ + + &jersey.common.CommonProperties.PROVIDER_DEFAULT_DISABLE; + + + jersey.config.disableDefaultProvider + + + Disable some of the default providers from being loaded. The following providers extend application footprint + by XML dependencies, which is too heavy for native image, or by AWT which may possibly be not available by JDK 11 desktop: + + java.awt.image.RenderedImage + javax.xml.transform.Source + javax.xml.transform.dom.DOMSource + javax.xml.transform.sax.SAXSource + javax.xml.transform.stream.StreamSource + + The following are the options to disable the provides: {@code DOMSOURCE, RENDEREDIMAGE, SAXSOURCE, SOURCE, STREAMSOURCE}, + or to disable all: {@code ALL}. Multiple options can be disabled by adding multiple comma separated values. + Default value is NULL + @since 2.30 + + &jersey.logging.LoggingFeature.LOGGING_FEATURE_LOGGER_NAME; @@ -503,8 +555,8 @@ - &jersey.server.ServerProperties.SUBRESOURCE_LOCATOR_CACHE_SIZE; - jersey.config.server.subresource.cache.size + &jersey.server.ServerProperties.SUBRESOURCE_LOCATOR_CACHE_AGE; + jersey.config.server.subresource.cache.age An integer value that defines the maximum age (in seconds) for cached for sub-resource locator @@ -526,6 +578,17 @@ + + &jersey.server.ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231; + jersey.config.server.headers.location.relative.resolution.rfc7231 + + + If true then Jersey will resolve relative URIs in the + Location http header against the request URI according to RFC7231 + (new HTTP Specification) + + + &jersey.server.ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED; jersey.config.server.headers.location.relative.resolution.disabled @@ -710,12 +773,22 @@ + + &jersey.client.ClientProperties.BACKGROUND_SCHEDULER_THREADPOOL_SIZE; + jersey.config.client.backgroundScheduler.threadPoolSize + + + Scheduler thread pool size. Default value is not set. + Support is undefined. + + + &jersey.client.ClientProperties.CHUNKED_ENCODING_SIZE; jersey.config.client.chunkedEncodingSize - Chunked encoding size. Default value is not set. + Chunked encoding size. Default value is 4096. @@ -863,6 +936,38 @@ + + &jersey.client.ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT; + jersey.config.client.digestAuthUriCacheSizeLimit + + + The property defines a URI of a HTTP proxy the client connector should use. + + + + + &jersey.client.ClientProperties.EXPECT_100_CONTINUE; + jersey.config.client.request.expect.100.continue.processing + + + Allows for HTTP Expect:100-Continue being handled by the HttpUrlConnector (default Jersey + connector). Since 2.32 + + + + + &jersey.client.ClientProperties.EXPECT_100_CONTINUE_THRESHOLD_SIZE; + jersey.config.client.request.expect.100.continue.threshold.size + + + Property for threshold size for content length after which Expect:100-Continue header would be applied + before the main request. + Default threshold size (64kb) after which which Expect:100-Continue header would be applied before + the main request. + Since 2.32 + + + &jersey.logging.LoggingFeature.LOGGING_FEATURE_LOGGER_NAME_CLIENT; diff --git a/docs/src/main/docbook/cdi.xml b/docs/src/main/docbook/cdi.xml index 69b88d66ba..c2a0ae75ee 100644 --- a/docs/src/main/docbook/cdi.xml +++ b/docs/src/main/docbook/cdi.xml @@ -50,7 +50,7 @@
Containers Known to Work With Jersey CDI Support - To stick with JAX-RS specification, Jersey has to support JAX-RS/CDI integration in Java EE environment. + To stick with JAX-RS specification, Jersey has to support JAX-RS/CDI integration in Java/Jakarta EE environment. The two containers supporting JAX-RS/CDI integration out of the box are Oracle GlassFish and Oracle WebLogic application server. diff --git a/docs/src/main/docbook/custom-di.xml b/docs/src/main/docbook/custom-di.xml index 621fc881cf..6b0f83aaf7 100644 --- a/docs/src/main/docbook/custom-di.xml +++ b/docs/src/main/docbook/custom-di.xml @@ -52,7 +52,7 @@ Implementing a custom injection provider that allows an application to define additional types to be injectable into Jersey-managed JAX-RS components. - Defining a custom injection annotation (other than &jee6.jakarta.inject.Inject; + Defining a custom injection annotation (other than &jee9.jakarta.inject.Inject; or &jaxrs.core.Context;) to mark application injection points. Specifying a custom component life cycle management for your application components. @@ -65,20 +65,20 @@ as a good example that will help me demonstrate implementation of the use cases described above. The following examples should work on top of Jersey Servlet integration module. The approach that will be demonstrated could be further generalized. - Below we will show how to make actual Servlet &jee6.servlet.HttpSession; injectable into JAX-RS components + Below we will show how to make actual Servlet &jee9.servlet.HttpSession; injectable into JAX-RS components and how to make this injection work with a custom inject annotation type. Finally, we will demonstrate - how you can write &lit.jee6.servlet.HttpSession;-scoped JAX-RS resources. + how you can write &lit.jee9.servlet.HttpSession;-scoped JAX-RS resources.
Implementing Custom Injection Provider - Jersey implementation allows you to directly inject &jee6.servlet.HttpServletRequest; instance into + Jersey implementation allows you to directly inject &jee9.servlet.HttpServletRequest; instance into your JAX-RS components. - It is quite straight forward to get the appropriate &lit.jee6.servlet.HttpSession; instance out of the + It is quite straight forward to get the appropriate &lit.jee9.servlet.HttpSession; instance out of the injected request instance. - Let say, you want to get &lit.jee6.servlet.HttpSession; instance directly injected into your JAX-RS + Let say, you want to get &lit.jee9.servlet.HttpSession; instance directly injected into your JAX-RS types like in the code snippet below. @Path("di-resource") @@ -93,7 +93,7 @@ public class MyDiResource { To make the above injection work, you will need to define an additional HK2 binding in your application &jersey.server.ResourceConfig;. Let's start with a custom HK2 &hk2.Factory; implementation that knows how to extract - &lit.jee6.servlet.HttpSession; out of given &lit.jee6.servlet.HttpServletRequest;. + &lit.jee9.servlet.HttpSession; out of given &lit.jee9.servlet.HttpServletRequest;. import org.glassfish.hk2.api.Factory; ... @@ -118,7 +118,7 @@ public class MyDiResource { } Please note that the factory implementation itself relies on having the actual - &lit.jee6.servlet.HttpServletRequest; instance injected. + &lit.jee9.servlet.HttpServletRequest; instance injected. In your implementation, you can of course depend on other types (and inject them conveniently) as long as these other types are bound to the actual HK2 service locator by Jersey or by your application. The key notion to remember here is that your HK2 &lit.hk2.Factory; implementation @@ -129,7 +129,7 @@ public class MyDiResource { Once implemented, the factory can be used in a custom HK2 &lit.hk2.Binder; to define the - new injection binding for &lit.jee6.servlet.HttpSession;. Finally, the implemented binder + new injection binding for &lit.jee9.servlet.HttpSession;. Finally, the implemented binder can be registered in your &jersey.server.ResourceConfig;: import org.glassfish.hk2.utilities.binding.AbstractBinder; @@ -204,7 +204,7 @@ public class MyApplication extends ResourceConfig { In the following example, we will describe how a custom injection annotation can be supported. Let's start with defining a new custom SessionInject injection annotation - that we will specifically use to inject instances of &jee6.servlet.HttpSession; + that we will specifically use to inject instances of &jee9.servlet.HttpSession; (similarly to the previous example): @Retention(RetentionPolicy.RUNTIME) @@ -235,7 +235,7 @@ public class MyDiResource { If you remember from the previous section, to make the injection in the code snippet above work, you first need to implement the injection provider (HK2 &hk2.Factory;) as well as define the - injection binding for the &lit.jee6.servlet.HttpSession; type. That part we have already + injection binding for the &lit.jee9.servlet.HttpSession; type. That part we have already done in the previous section. We will now focus on what needs to be done to inform the HK2 runtime about our @SessionInject annotation type that we want to support as a new injection point marker annotation. To do that, @@ -288,7 +288,7 @@ public class SessionInjectResolver implements InjectionResolver<SessionInject HK2 binder that registers both, the injection provider from the previous step as well as the new HK2 inject resolver with Jersey application &lit.jersey.server.ResourceConfig;. Note that in this case we're explicitly binding the SessionInjectResolver - to a &jee6.inject.Singleton; scope to avoid the unnecessary proliferation of + to a &jee9.inject.Singleton; scope to avoid the unnecessary proliferation of SessionInjectResolver instances in the application: import org.glassfish.hk2.api.TypeLiteral; @@ -328,14 +328,14 @@ public class MyApplication extends ResourceConfig { If not configured otherwise, then all JAX-RS resources are by default managed on a per-request basis. A new instance of given resource class will be created for each incoming request that should be handled by that resource class. Let say you want to have your resource class managed in a per-session manner. It means a new instance of your - resource class should be created only when a new Servlet &jee6.servlet.HttpSession; is established. + resource class should be created only when a new Servlet &jee9.servlet.HttpSession; is established. (As with previous examples in the chapter, this example assumes the deployment of your application to a Servlet container.) Following is an example of such a resource class that builds on the support for - &lit.jee6.servlet.HttpSession; injection from the earlier examples described in this chapter. + &lit.jee9.servlet.HttpSession; injection from the earlier examples described in this chapter. The PerSessionResource class allows you to count the number of requests made within a single client session and provides you a handy sub-resource method to obtain the number via a HTTP &lit.http.GET; method call: @@ -368,7 +368,7 @@ public class PerSessionResource { The value of this field would get incremented to 1 in the the getSessionRequestCount method before this value is returned. In order to achieve what we want, we have to find a way how to bind the instances of - our PerSessionResource class to &lit.jee6.servlet.HttpSession; instances and + our PerSessionResource class to &lit.jee9.servlet.HttpSession; instances and then reuse those bound instances whenever new request bound to the same HTTP client session arrives. Let's see how to achieve this. diff --git a/docs/src/main/docbook/how-to-build.xml b/docs/src/main/docbook/how-to-build.xml index 368dc57e8d..767ac0c671 100644 --- a/docs/src/main/docbook/how-to-build.xml +++ b/docs/src/main/docbook/how-to-build.xml @@ -1,7 +1,7 @@ @@ -841,8 +842,8 @@ System.out.println("Access Token: " + result.get);]]> Between the calls to flow.start() and flow.finish(), a user must be redirected to the authorization URI. This means that the code will not be executed in a single method and the finish part will be invoked as a handler of redirect request back to our web from - authorization URI. Check the &jersey.github.oauth2.google.client.example.link; for more details on - this approach. + authorization URI.
diff --git a/docs/src/main/docbook/test-framework.xml b/docs/src/main/docbook/test-framework.xml index e32c14e98d..77c33c9f88 100644 --- a/docs/src/main/docbook/test-framework.xml +++ b/docs/src/main/docbook/test-framework.xml @@ -96,7 +96,8 @@ &jersey.test.JerseyTest; supports deploying applications on various containers, all (except the external container wrapper) need to have some "glue" code to be supported. Currently Jersey Test Framework provides support for Grizzly, In-Memory, JDK (com.sun.net.httpserver.HttpServer), Simple HTTP container - (org.simpleframework.http) and Jetty HTTP container (org.eclipse.jetty). + (org.simpleframework.http) and Jetty HTTP container (org.eclipse.jetty) + - since Jersey 3.x HTTP Jetty container requires JDK 11+. @@ -149,7 +150,7 @@ - HttpServer from Oracle JDK is another supported test container. + HttpServer from JDK is another supported test container. <dependency> <groupId>org.glassfish.jersey.test-framework.providers</groupId> @@ -173,7 +174,7 @@ Jetty container (org.eclipse.jetty) is another high-performance, light-weight HTTP server - that integrates with Jersey and is supported by Jersey Test Framework. + that integrates with Jersey and is supported by Jersey Test Framework. Shall be used along with JDK 11+ <dependency> <groupId>org.glassfish.jersey.test-framework.providers</groupId> diff --git a/docs/src/main/docbook/user-guide.xml b/docs/src/main/docbook/user-guide.xml index bddbfacb2a..52aa59f144 100644 --- a/docs/src/main/docbook/user-guide.xml +++ b/docs/src/main/docbook/user-guide.xml @@ -115,7 +115,7 @@ This line fits the page width. - + diff --git a/docs/src/main/docbook/wadl.xml b/docs/src/main/docbook/wadl.xml index 991f8e45e6..853a662070 100644 --- a/docs/src/main/docbook/wadl.xml +++ b/docs/src/main/docbook/wadl.xml @@ -73,10 +73,10 @@ public static class CountryResource { The WADL of a Jersey application that contains the resource above can be requested by a HTTP &lit.http.GET; request to http://localhost:9998/application.wadl. - The Jersey will return a response with a WADL content similar to the one in the following example: + Jersey will return a response with a WADL content similar to the one in the following example: - + @@ -111,8 +111,8 @@ public static class CountryResource { A simple WADL example - WADL content - - + + @@ -269,7 +269,7 @@ public static class CountryResource { <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <application xmlns="http://wadl.dev.java.net/2009/02"> <doc xmlns:jersey="http://jersey.java.net/" - jersey:generatedBy="Jersey: 2.0-SNAPSHOT ${buildNumber}"/> + jersey:generatedBy="Jersey: 3.0.0 ${buildNumber}"/> <grammars/> <resources base="http://localhost:9998/"> <resource path="country/15"> @@ -381,7 +381,7 @@ public static class CustomerAddressSubResource { <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <application xmlns="http://wadl.dev.java.net/2009/02"> <doc xmlns:jersey="http://jersey.java.net/" - jersey:generatedBy="Jersey: 2.0-SNAPSHOT ${buildNumber}"/> + jersey:generatedBy="Jersey: 3.0.0 ${buildNumber}"/> <grammars/> <resources base="http://localhost:9998/"> <resource path="customer/{id}"> @@ -552,7 +552,7 @@ public static class CustomerAddressSubResource { Extended WADL support Please note that the API of extended WADL support is going to be changed in one of the future - releases of Jersey 2.x (see below). + releases of Jersey 3.x (see below). Jersey supports extension of WADL generation called extended WADL. Using the extended WADL @@ -561,7 +561,7 @@ public static class CustomerAddressSubResource { adding external grammar support, or adding any custom WADL extension information. - Again, note that the extended WADL in Jersey 2.x is NOT the intended final version and + Again, note that the extended WADL in Jersey 3.x is NOT the intended final version and API is going to be changed. The existing set of features and functionality will be preserved but the APIs will be significantly re-designed to support additional use cases. This impacts mainly the APIs of &jersey.server.WadlGenerator;, &jersey.server.WadlGeneratorConfig; as well as any related classes. The API changes From 2bf459484ace0d4a1d1c7dc271c1d8ae34c63a2d Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Tue, 5 Jan 2021 12:00:27 +0100 Subject: [PATCH 2/2] Jakartified User Guide - 3 chapters revised Signed-off-by: Maxim Nesen --- docs/src/main/docbook/how-to-build.xml | 4 ++-- docs/src/main/docbook/logging.xml | 4 ++-- docs/src/main/docbook/test-framework.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/main/docbook/how-to-build.xml b/docs/src/main/docbook/how-to-build.xml index 767ac0c671..a0408f489f 100644 --- a/docs/src/main/docbook/how-to-build.xml +++ b/docs/src/main/docbook/how-to-build.xml @@ -1,7 +1,7 @@