Jetty 12.1 Programming Guide

The Eclipse Jetty Programming Guide targets developers who want to use the Jetty libraries in their applications.

The Jetty libraries provide the client-side and server-side APIs to work with various web protocols such as HTTP/1.1, HTTP/2, HTTP/3, WebSocket and FastCGI.

You may use the Jetty client-side library in your application to make calls to third party REST services, or to other REST microservices in your system.

Likewise, you may use the Jetty server-side library to quickly create an HTTP or REST service without having to create a full Jakarta EE web application archive file (a *.war file) and without having to deploy it to a Jetty standalone server that you would have to download and install.

This guide will walk you through the design of the Jetty libraries and how to use its classes to write your applications.

Code Deprecation Policy

As the Jetty code evolves, classes and/or methods are deprecated using the @Deprecated annotation and will be removed in a future Jetty release.

The Jetty release numbering follows this scheme: <major>.<minor>.<micro>. For example, 12.0.5 has major=12, minor=0 and micro=5.

The policy to remove deprecated code is the following:

  • Code deprecated in a Jetty release x.y.z is not removed in subsequent micro releases x.y.(z+n).

  • Code deprecated in a Jetty release x.y.z may be removed in the next minor release x.(y+1).0, but only if it has been deprecated for more than six micro releases.

  • Code deprecated in a Jetty release x.y.z may be removed in the next major release (x+1).0.0 without restrictions.

For example, let’s assume that some code codeA is deprecated in Jetty 12.0.5, and some other code codeB is deprecated in Jetty 12.0.8. Let’s also assume that 12.1.0 (a new minor release) is released after the release of Jetty 12.0.11.

Then, by the rules above:

  • Neither codeA nor codeB are removed from the Jetty 12.0.x releases.

  • Code codeA is removed from Jetty 12.1.0 because it has been deprecated for more than six micro releases, since Jetty 12.1.0 is released after Jetty 12.0.11.

  • Code codeB is not removed from Jetty 12.1.0 because it has been deprecated for less than six micro releases. As codeB is now part of Jetty 12.1.0, it will not be removed from the Jetty 12.1.x releases.

There could be rare cases where code (possibly not even deprecated) must be removed earlier than specified above to address security vulnerabilities.