Skip to content

Commit d425c97

Browse files
committed
Improvements to the Jetty documentation.
Restructured the programming guide. Added collapsible TOC. Signed-off-by: Simone Bordet <[email protected]>
1 parent a495539 commit d425c97

27 files changed

+101
-100
lines changed

documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-jmx.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-arch-jmx]]
15-
== Jetty JMX Support
15+
=== Jetty JMX Support
1616

1717
The Java Management Extensions (JMX) APIs are standard API for managing and monitoring resources such as applications, devices, services, and the Java Virtual Machine itself.
1818

@@ -38,7 +38,7 @@ The Maven coordinates for the Jetty JMX support are:
3838
</dependency>
3939
----
4040

41-
=== Enabling JMX Support
41+
==== Enabling JMX Support
4242

4343
Enabling JMX support is always recommended because it provides valuable information about the system, both for monitoring purposes and for troubleshooting purposes in case of problems.
4444

@@ -67,7 +67,7 @@ In these cases, you have to enable xref:pg-arch-jmx-remote[JMX Remote Access].
6767
// TODO: add a section about how to expose logging once #4830 is fixed.
6868

6969
[[pg-arch-jmx-remote]]
70-
=== Enabling JMX Remote Access
70+
==== Enabling JMX Remote Access
7171

7272
There are two ways of enabling remote connectivity so that JMC can connect to the remote JVM to visualize MBeans.
7373

@@ -148,7 +148,7 @@ include::{doc_code}/org/eclipse/jetty/docs/programming/JMXDocs.java[tags=remote]
148148
----
149149

150150
[[pg-arch-jmx-remote-authorization]]
151-
==== JMX Remote Access Authorization
151+
===== JMX Remote Access Authorization
152152

153153
The standard `JMXConnectorServer` provides several options to authorize access, for example via JAAS or via configuration files.
154154
For a complete guide to controlling authentication and authorization in JMX, see https://docs.oracle.com/en/java/javase/11/management/[the official JMX documentation].
@@ -242,7 +242,7 @@ When you configure `ConnectorServer` in this way, you must set the system proper
242242
This is required because when the RMI server is exported, its address and port are stored in the RMI stub. You want the address in the RMI stub to be `localhost` so that when the RMI stub is downloaded to the remote client, the RMI communication will go through the SSH tunnel.
243243

244244
[[pg-arch-jmx-annotation]]
245-
=== Jetty JMX Annotations
245+
==== Jetty JMX Annotations
246246

247247
The Jetty JMX support, and in particular `MBeanContainer`, is notified every time a bean is added to the component tree.
248248

@@ -278,24 +278,24 @@ For each type -- class or interface, the corresponding `+*.jmx.*MBean+` is looke
278278
For each type, the scan looks for the class-level annotation `@ManagedObject`.
279279
If it is found, the scan looks for method-level `@ManagedAttribute` and `@ManagedOperation` annotations; otherwise it skips the current type and moves to the next type to scan.
280280

281-
==== @ManagedObject
281+
===== @ManagedObject
282282

283283
The `@ManagedObject` annotation is used on a class at the top level to indicate that it should be exposed as an MBean.
284284
It has only one attribute to it which is used as the description of the MBean.
285285

286-
==== @ManagedAttribute
286+
===== @ManagedAttribute
287287

288288
The `@ManagedAttribute` annotation is used to indicate that a given method is exposed as a JMX attribute.
289289
This annotation is placed always on the getter method of a given attribute.
290290
Unless the `readonly` attribute is set to `true` in the annotation, a corresponding setter is looked up following normal naming conventions.
291291
For example if this annotation is on a method called `String getFoo()` then a method called `void setFoo(String)` would be looked up, and if found wired as the setter for the JMX attribute.
292292

293-
==== @ManagedOperation
293+
===== @ManagedOperation
294294

295295
The `@ManagedOperation` annotation is used to indicate that a given method is exposed as a JMX operation.
296296
A JMX operation has an _impact_ that can be `INFO` if the operation returns a value without modifying the object, `ACTION` if the operation does not return a value but modifies the object, and "ACTION_INFO" if the operation both returns a value and modifies the object.
297297
If the _impact_ is not specified, it has the default value of `UNKNOWN`.
298298

299-
==== @Name
299+
===== @Name
300300

301301
The `@Name` annotation is used to assign a name and description to parameters in method signatures so that when rendered by JMX consoles it is clearer what the parameter meaning is.

documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
== Jetty Architecture
1717

1818
include::arch-bean.adoc[]
19-
include::arch-jmx.adoc[]
20-
include::arch-listener.adoc[]
2119
include::arch-io.adoc[]
20+
include::arch-listener.adoc[]
21+
include::arch-jmx.adoc[]

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/client.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ These are the available client libraries:
2929

3030
If you are interested in the low-level details of how the Eclipse Jetty client libraries work, or are interested in writing a custom protocol, look at the xref:pg-client-io-arch[Client I/O Architecture].
3131

32+
include::client-io-arch.adoc[]
3233
include::http/client-http.adoc[]
3334
include::http2/client-http2.adoc[]
34-
include::client-io-arch.adoc[]
35+
include::websocket/client-websocket.adoc[]

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-api.adoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
//
1313

1414
[[pg-client-http-api]]
15-
=== HttpClient API Usage
15+
==== HttpClient API Usage
1616

1717
`HttpClient` provides two types of APIs: a blocking API and a non-blocking API.
1818

1919
[[pg-client-http-blocking]]
20-
==== HttpClient Blocking APIs
20+
===== HttpClient Blocking APIs
2121

2222
The simpler way to perform a HTTP request is the following:
2323

@@ -77,7 +77,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
7777
In the example above, when the 5 seconds expire, the request/response cycle is aborted and a `java.util.concurrent.TimeoutException` is thrown.
7878

7979
[[pg-client-http-non-blocking]]
80-
==== HttpClient Non-Blocking APIs
80+
===== HttpClient Non-Blocking APIs
8181

8282
So far we have shown how to use Jetty HTTP client in a blocking style -- that is, the thread that issues the request blocks until the request/response conversation is complete.
8383

@@ -135,9 +135,6 @@ This makes Jetty HTTP client suitable for HTTP load testing because, for example
135135

136136
Have a look at the link:{JDURL}/org/eclipse/jetty/client/api/Request.Listener.html[`Request.Listener`] class to know about request events, and to the link:{JDURL}/org/eclipse/jetty/client/api/Response.Listener.html[`Response.Listener`] class to know about response events.
137137

138-
[[pg-client-http-content]]
139-
==== HttpClient Content Handling
140-
141138
[[pg-client-http-content-request]]
142139
===== Request Content Handling
143140

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-authentication.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-authentication]]
15-
=== HttpClient Authentication Support
15+
==== HttpClient Authentication Support
1616

1717
Jetty's `HttpClient` supports the `BASIC` and `DIGEST` authentication mechanisms defined by link:https://tools.ietf.org/html/rfc7235[RFC 7235], as well as the SPNEGO authentication mechanism defined in link:https://tools.ietf.org/html/rfc4559[RFC 4559].
1818

@@ -76,5 +76,5 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
7676
See also the xref:pg-client-http-proxy-authentication[proxy authentication section] for further information about how authentication works with HTTP proxies.
7777

7878
[[pg-client-http-authentication-spnego]]
79-
=== HttpClient SPNEGO Authentication Support
79+
===== HttpClient SPNEGO Authentication Support
8080
TODO

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-configuration.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-configuration]]
15-
=== HttpClient Configuration
15+
==== HttpClient Configuration
1616

1717
`HttpClient` has a quite large number of configuration parameters.
1818
Please refer to the `HttpClient` link:{JDURL}/org/eclipse/jetty/client/HttpClient.html[javadocs] for the complete list of configurable parameters.
@@ -26,7 +26,7 @@ The most common parameters are:
2626
* `HttpClient.maxRequestsQueuedPerDestination`: the max number of requests queued (defaults to 1024).
2727

2828
[[pg-client-http-configuration-tls]]
29-
==== HttpClient TLS Configuration
29+
===== HttpClient TLS Configuration
3030

3131
`HttpClient` supports HTTPS requests out-of-the-box like a browser does.
3232

@@ -64,9 +64,9 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
6464
Please refer to the `SslContextFactory.Client` link:{JDURL}/org/eclipse/jetty/util/ssl/SslContextFactory.Client.html[javadocs] for the complete list of configurable parameters.
6565

6666
[[pg-client-http-configuration-tls-truststore]]
67-
==== HttpClient TLS TrustStore Configuration
67+
====== HttpClient TLS TrustStore Configuration
6868
TODO
6969

7070
[[pg-client-http-configuration-tls-client-certs]]
71-
==== HttpClient TLS Client Certificates Configuration
71+
====== HttpClient TLS Client Certificates Configuration
7272
TODO

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-cookie.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-cookie]]
15-
=== HttpClient Cookie Support
15+
==== HttpClient Cookie Support
1616

1717
Jetty's `HttpClient` supports cookies out of the box.
1818

@@ -65,7 +65,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
6565
The example above will retain only cookies that come from the `google.com` domain or sub-domains.
6666

6767
// TODO: move this section to server-side
68-
==== Special Characters in Cookies
68+
===== Special Characters in Cookies
6969

7070
Jetty is compliant with link:https://tools.ietf.org/html/rfc6265[RFC6265], and as such care must be taken when setting a cookie value that includes special characters such as `;`.
7171

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-intro.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-intro]]
15-
=== HttpClient Introduction
15+
==== HttpClient Introduction
1616

1717
The Jetty HTTP client module provides easy-to-use APIs and utility classes to perform HTTP (or HTTPS) requests.
1818

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-proxy.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-proxy]]
15-
=== HttpClient Proxy Support
15+
==== HttpClient Proxy Support
1616

1717
Jetty's `HttpClient` can be configured to use proxies to connect to destinations.
1818

@@ -33,7 +33,7 @@ Configured in this way, `HttpClient` makes requests to the HTTP proxy (for plain
3333
Proxying is supported for both HTTP/1.1 and HTTP/2.
3434

3535
[[pg-client-http-proxy-authentication]]
36-
==== Proxy Authentication Support
36+
===== Proxy Authentication Support
3737

3838
Jetty's `HttpClient` supports proxy authentication in the same way it supports xref:pg-client-http-authentication[server authentication].
3939

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-transport.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313

1414
[[pg-client-http-transport]]
15-
=== HttpClient Pluggable Transports
15+
==== HttpClient Pluggable Transports
1616

1717
Jetty's `HttpClient` can be configured to use different transports to carry the semantic of HTTP requests and responses.
1818

@@ -57,7 +57,7 @@ Applications are typically not aware of the actual protocol being used.
5757
This allows them to write their logic against a high-level API that hides the details of the specific protocol being used over the network.
5858

5959
[[pg-client-http-transport-http11]]
60-
==== HTTP/1.1 Transport
60+
===== HTTP/1.1 Transport
6161

6262
HTTP/1.1 is the default transport.
6363

@@ -74,7 +74,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
7474
----
7575

7676
[[pg-client-http-transport-http2]]
77-
==== HTTP/2 Transport
77+
===== HTTP/2 Transport
7878

7979
The HTTP/2 transport can be configured in this way:
8080

@@ -88,7 +88,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli
8888
`HttpClientTransportOverHTTP2` uses `HTTP2Client` to format high-level semantic HTTP requests (like "GET resource /index.html") into the HTTP/2 specific format.
8989

9090
[[pg-client-http-transport-fcgi]]
91-
==== FastCGI Transport
91+
===== FastCGI Transport
9292

9393
The FastCGI transport can be configured in this way:
9494

@@ -102,7 +102,7 @@ In order to make requests using the FastCGI transport, you need to have a FastCG
102102
The FastCGI transport is primarily used by Jetty's xref:fastcgi[FastCGI support] to serve PHP pages (WordPress for example).
103103

104104
[[pg-client-http-transport-dynamic]]
105-
==== Dynamic Transport
105+
===== Dynamic Transport
106106

107107
The static transports work well if you know in advance the protocol you want to speak with the server, or if the server only supports one protocol (such as FastCGI).
108108

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http2/client-http2.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ A _session_ typically has a long life -- once the TCP connection is established,
5757
include::../../http2.adoc[tag=multiplex]
5858

5959
[[pg-client-http2-flow-control]]
60-
===== HTTP/2 Flow Control
60+
==== HTTP/2 Flow Control
6161

6262
include::../../http2.adoc[tag=flowControl]
6363

@@ -84,7 +84,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http2/HTTP2C
8484
IMPORTANT: Applications must know in advance whether they want to connect to a clear-text or encrypted port, and pass the `SslContextFactory` parameter accordingly to the `connect(...)` method.
8585

8686
[[pg-client-http2-configure]]
87-
===== Configuring the Session
87+
==== Configuring the Session
8888

8989
The `connect(...)` method takes a `Session.Listener` parameter.
9090
This listener's `onPreface(...)` method is invoked just before establishing the connection to the server to gather the client configuration to send to the server.

documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/websocket/client-websocket.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
//
1313

1414
[[pg-client-websocket]]
15-
=== WebSocket Client Libraries
15+
=== WebSocket Client
1616

1717
TODO
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<link rel="stylesheet" href="../styles.css">
2+
<link rel="stylesheet" href="../toc.css">
3+
<script src="../toc.js"></script>

documentation/jetty-documentation/src/main/asciidoc/programming-guide/index.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
//
1313

1414
:doctitle: Eclipse Jetty: Programming Guide
15-
:toc-title: Programming Guide
15+
:toc-title: Jetty Programming Guide
1616
:breadcrumb: Home:../index.html | Programming Guide:./index.html
1717
:idprefix: pg-
18+
:docinfo: private-head
1819

1920
include::../config.adoc[]
2021
include::.asciidoctorconfig[]

documentation/jetty-documentation/src/main/asciidoc/programming-guide/server/http/server-http-application.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
//
1313

1414
[[pg-server-http-application]]
15-
=== Writing HTTP Server Applications
15+
===== Writing HTTP Server Applications
1616

1717
Writing HTTP applications is typically simple, especially when using blocking APIs.
1818
However, there are subtle cases where it is worth clarifying what a server application should do to obtain the desired results when run by Jetty.
1919

2020
[[pg-server-http-application-1xx]]
21-
==== Sending 1xx Responses
21+
====== Sending 1xx Responses
2222

2323
The link:https://tools.ietf.org/html/rfc7231#section-5.1.1[HTTP/1.1 RFC] allows for `1xx` informational responses to be sent before a real content response.
2424
Unfortunately the servlet specification does not provide a way for these to be sent, so Jetty has had to provide non-standard handling of these headers.
2525

2626
[[pg-server-http-application-100]]
27-
===== 100 Continue
27+
====== 100 Continue
2828

2929
The `100 Continue` response should be sent by the server when a client sends a request with an `Expect: 100-continue` header, as the client will not send the body of the request until the `100 Continue` response has been sent.
3030

@@ -39,7 +39,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/server/http/HTTPSer
3939
----
4040

4141
[[jetty-102-processing]]
42-
===== 102 Processing
42+
====== 102 Processing
4343

4444
link:https://tools.ietf.org/html/rfc2518[RFC 2518] defined the `102 Processing` status code that can be sent:
4545

0 commit comments

Comments
 (0)