Extract recurring asciidoc links to attributes, cleanup old doc files
This commit extract spring-related links and recurring external links into asciidoctor attributes to be used by the Antora toolchain. It notably homogenizes links to: - IETF RFCs - Java Community Process JSRs - the Java API Documentation (on the Java 17 version) - Kotlin documentations (on the Kotlinlang.org version) - the Spring Boot reference guide (on the `html` version) This commit also reworks most link attributes to follow a Project-Category-Misc syntax. For example, `spring-boot-docs` rather than `docs-spring-boot`. Finally, it makes an effort to clean up remainders from the previous documentation toolchain, namely the `docs/asciidoc` folder and `modules/ROOT/pages/attributes.adoc` file. Closes gh-26864 Closes gh-31619
This commit is contained in:
@@ -23,20 +23,20 @@ change application code.
|
||||
|
||||
SockJS consists of:
|
||||
|
||||
* The https://github.com/sockjs/sockjs-protocol[SockJS protocol]
|
||||
* The {sockjs-protocol}[SockJS protocol]
|
||||
defined in the form of executable
|
||||
https://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html[narrated tests].
|
||||
* The https://github.com/sockjs/sockjs-client/[SockJS JavaScript client] -- a client library for use in browsers.
|
||||
{sockjs-protocol-site}/sockjs-protocol-0.3.3.html[narrated tests].
|
||||
* The {sockjs-client}[SockJS JavaScript client] -- a client library for use in browsers.
|
||||
* SockJS server implementations, including one in the Spring Framework `spring-websocket` module.
|
||||
* A SockJS Java client in the `spring-websocket` module (since version 4.1).
|
||||
|
||||
SockJS is designed for use in browsers. It uses a variety of techniques
|
||||
to support a wide range of browser versions.
|
||||
For the full list of SockJS transport types and browsers, see the
|
||||
https://github.com/sockjs/sockjs-client/[SockJS client] page. Transports
|
||||
{sockjs-client}[SockJS client] page. Transports
|
||||
fall in three general categories: WebSocket, HTTP Streaming, and HTTP Long Polling.
|
||||
For an overview of these categories, see
|
||||
https://spring.io/blog/2012/05/08/spring-mvc-3-2-preview-techniques-for-real-time-updates/[this blog post].
|
||||
{spring-site-blog}/2012/05/08/spring-mvc-3-2-preview-techniques-for-real-time-updates/[this blog post].
|
||||
|
||||
The SockJS client begins by sending `GET /info` to
|
||||
obtain basic information from the server. After that, it must decide what transport
|
||||
@@ -130,13 +130,13 @@ The preceding example is for use in Spring MVC applications and should be includ
|
||||
configuration of a xref:web/webmvc/mvc-servlet.adoc[`DispatcherServlet`]. However, Spring's WebSocket
|
||||
and SockJS support does not depend on Spring MVC. It is relatively simple to
|
||||
integrate into other HTTP serving environments with the help of
|
||||
{api-spring-framework}/web/socket/sockjs/support/SockJsHttpRequestHandler.html[`SockJsHttpRequestHandler`].
|
||||
{spring-framework-api}/web/socket/sockjs/support/SockJsHttpRequestHandler.html[`SockJsHttpRequestHandler`].
|
||||
|
||||
On the browser side, applications can use the
|
||||
https://github.com/sockjs/sockjs-client/[`sockjs-client`] (version 1.0.x). It
|
||||
{sockjs-client}[`sockjs-client`] (version 1.0.x). It
|
||||
emulates the W3C WebSocket API and communicates with the server to select the best
|
||||
transport option, depending on the browser in which it runs. See the
|
||||
https://github.com/sockjs/sockjs-client/[sockjs-client] page and the list of
|
||||
{sockjs-client}[sockjs-client] page and the list of
|
||||
transport types supported by browser. The client also provides several
|
||||
configuration options -- for example, to specify which transports to include.
|
||||
|
||||
@@ -183,7 +183,7 @@ but can be configured to do so. In the future, it may set it by default.
|
||||
See {docs-spring-security}/features/exploits/headers.html#headers-default[Default Security Headers]
|
||||
of the Spring Security documentation for details on how to configure the
|
||||
setting of the `X-Frame-Options` header. You can also see
|
||||
https://github.com/spring-projects/spring-security/issues/2718[gh-2718]
|
||||
{spring-github-org}/spring-security/issues/2718[gh-2718]
|
||||
for additional background.
|
||||
====
|
||||
|
||||
@@ -219,7 +219,7 @@ The XML namespace provides a similar option through the `<websocket:sockjs>` ele
|
||||
NOTE: During initial development, do enable the SockJS client `devel` mode that prevents
|
||||
the browser from caching SockJS requests (like the iframe) that would otherwise
|
||||
be cached. For details on how to enable it see the
|
||||
https://github.com/sockjs/sockjs-client/[SockJS client] page.
|
||||
{sockjs-client}[SockJS client] page.
|
||||
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ from concluding that a connection is hung. The Spring SockJS configuration has a
|
||||
called `heartbeatTime` that you can use to customize the frequency. By default, a
|
||||
heartbeat is sent after 25 seconds, assuming no other messages were sent on that
|
||||
connection. This 25-second value is in line with the following
|
||||
https://tools.ietf.org/html/rfc6202[IETF recommendation] for public Internet applications.
|
||||
{rfc-site}/rfc6202[IETF recommendation] for public Internet applications.
|
||||
|
||||
NOTE: When using STOMP over WebSocket and SockJS, if the STOMP client and server negotiate
|
||||
heartbeats to be exchanged, the SockJS heartbeats are disabled.
|
||||
@@ -248,7 +248,7 @@ should consider customizing the settings according to your specific needs.
|
||||
|
||||
HTTP streaming and HTTP long polling SockJS transports require a connection to remain
|
||||
open longer than usual. For an overview of these techniques, see
|
||||
https://spring.io/blog/2012/05/08/spring-mvc-3-2-preview-techniques-for-real-time-updates/[this blog post].
|
||||
{spring-site-blog}/2012/05/08/spring-mvc-3-2-preview-techniques-for-real-time-updates/[this blog post].
|
||||
|
||||
In Servlet containers, this is done through Servlet 3 asynchronous support that
|
||||
allows exiting the Servlet container thread, processing a request, and continuing
|
||||
|
||||
@@ -84,13 +84,13 @@ The preceding example is for use in Spring MVC applications and should be includ
|
||||
in the configuration of a xref:web/webmvc/mvc-servlet.adoc[`DispatcherServlet`]. However, Spring's
|
||||
WebSocket support does not depend on Spring MVC. It is relatively simple to
|
||||
integrate a `WebSocketHandler` into other HTTP-serving environments with the help of
|
||||
{api-spring-framework}/web/socket/server/support/WebSocketHttpRequestHandler.html[`WebSocketHttpRequestHandler`].
|
||||
{spring-framework-api}/web/socket/server/support/WebSocketHttpRequestHandler.html[`WebSocketHttpRequestHandler`].
|
||||
|
||||
When using the `WebSocketHandler` API directly vs indirectly, e.g. through the
|
||||
xref:web/websocket/stomp.adoc[STOMP] messaging, the application must synchronize the sending of messages
|
||||
since the underlying standard WebSocket session (JSR-356) does not allow concurrent
|
||||
sending. One option is to wrap the `WebSocketSession` with
|
||||
{api-spring-framework}/web/socket/handler/ConcurrentWebSocketSessionDecorator.html[`ConcurrentWebSocketSessionDecorator`].
|
||||
{spring-framework-api}/web/socket/handler/ConcurrentWebSocketSessionDecorator.html[`ConcurrentWebSocketSessionDecorator`].
|
||||
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ As of Spring Framework 4.1.5, the default behavior for WebSocket and SockJS is t
|
||||
only same-origin requests. It is also possible to allow all or a specified list of origins.
|
||||
This check is mostly designed for browser clients. Nothing prevents other types
|
||||
of clients from modifying the `Origin` header value (see
|
||||
https://tools.ietf.org/html/rfc6454[RFC 6454: The Web Origin Concept] for more details).
|
||||
{rfc-site}/rfc6454[RFC 6454: The Web Origin Concept] for more details).
|
||||
|
||||
The three possible behaviors are:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[websocket-stomp-authentication-token-based]]
|
||||
= Token Authentication
|
||||
|
||||
https://github.com/spring-projects/spring-security-oauth[Spring Security OAuth]
|
||||
{spring-github-org}/spring-security-oauth[Spring Security OAuth]
|
||||
provides support for token based security, including JSON Web Token (JWT).
|
||||
You can use this as the authentication mechanism in Web applications,
|
||||
including STOMP over WebSocket interactions, as described in the previous
|
||||
@@ -11,13 +11,13 @@ At the same time, cookie-based sessions are not always the best fit (for example
|
||||
in applications that do not maintain a server-side session or in
|
||||
mobile applications where it is common to use headers for authentication).
|
||||
|
||||
The https://tools.ietf.org/html/rfc6455#section-10.5[WebSocket protocol, RFC 6455]
|
||||
The {rfc-site}/rfc6455#section-10.5[WebSocket protocol, RFC 6455]
|
||||
"doesn't prescribe any particular way that servers can authenticate clients during
|
||||
the WebSocket handshake." In practice, however, browser clients can use only standard
|
||||
authentication headers (that is, basic HTTP authentication) or cookies and cannot (for example)
|
||||
provide custom headers. Likewise, the SockJS JavaScript client does not provide
|
||||
a way to send HTTP headers with SockJS transport requests. See
|
||||
https://github.com/sockjs/sockjs-client/issues/196[sockjs-client issue 196].
|
||||
{sockjs-client}/issues/196[sockjs-client issue 196].
|
||||
Instead, it does allow sending query parameters that you can use to send a token,
|
||||
but that has its own drawbacks (for example, the token may be inadvertently
|
||||
logged with the URL in server logs).
|
||||
|
||||
@@ -6,7 +6,7 @@ Spring Security provides
|
||||
{docs-spring-security}/servlet/integrations/websocket.html#websocket-authorization[WebSocket sub-protocol authorization]
|
||||
that uses a `ChannelInterceptor` to authorize messages based on the user header in them.
|
||||
Also, Spring Session provides
|
||||
https://docs.spring.io/spring-session/reference/web-socket.html[WebSocket integration]
|
||||
{docs-spring-session}/web-socket.html[WebSocket integration]
|
||||
that ensures the user's HTTP session does not expire while the WebSocket session is still active.
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ and xref:web/websocket/stomp/authentication.adoc[Authentication] for more inform
|
||||
|
||||
For more example code see:
|
||||
|
||||
* https://spring.io/guides/gs/messaging-stomp-websocket/[Using WebSocket to build an
|
||||
* {spring-site-guides}/gs/messaging-stomp-websocket/[Using WebSocket to build an
|
||||
interactive web application] -- a getting started guide.
|
||||
* https://github.com/rstoyanchev/spring-websocket-portfolio[Stock Portfolio] -- a sample
|
||||
application.
|
||||
|
||||
@@ -59,7 +59,7 @@ The following example shows the XML configuration equivalent of the preceding ex
|
||||
----
|
||||
|
||||
The STOMP broker relay in the preceding configuration is a Spring
|
||||
{api-spring-framework}/messaging/MessageHandler.html[`MessageHandler`]
|
||||
{spring-framework-api}/messaging/MessageHandler.html[`MessageHandler`]
|
||||
that handles messages by forwarding them to an external message broker.
|
||||
To do so, it establishes TCP connections to the broker, forwards all messages to it,
|
||||
and then forwards all messages received from the broker to clients through their
|
||||
|
||||
@@ -7,18 +7,18 @@ connected clients. This section describes the flow of messages on the server sid
|
||||
The `spring-messaging` module contains foundational support for messaging applications
|
||||
that originated in https://spring.io/spring-integration[Spring Integration] and was
|
||||
later extracted and incorporated into the Spring Framework for broader use across many
|
||||
https://spring.io/projects[Spring projects] and application scenarios.
|
||||
{spring-site-projects}[Spring projects] and application scenarios.
|
||||
The following list briefly describes a few of the available messaging abstractions:
|
||||
|
||||
* {api-spring-framework}/messaging/Message.html[Message]:
|
||||
* {spring-framework-api}/messaging/Message.html[Message]:
|
||||
Simple representation for a message, including headers and payload.
|
||||
* {api-spring-framework}/messaging/MessageHandler.html[MessageHandler]:
|
||||
* {spring-framework-api}/messaging/MessageHandler.html[MessageHandler]:
|
||||
Contract for handling a message.
|
||||
* {api-spring-framework}/messaging/MessageChannel.html[MessageChannel]:
|
||||
* {spring-framework-api}/messaging/MessageChannel.html[MessageChannel]:
|
||||
Contract for sending a message that enables loose coupling between producers and consumers.
|
||||
* {api-spring-framework}/messaging/SubscribableChannel.html[SubscribableChannel]:
|
||||
* {spring-framework-api}/messaging/SubscribableChannel.html[SubscribableChannel]:
|
||||
`MessageChannel` with `MessageHandler` subscribers.
|
||||
* {api-spring-framework}/messaging/support/ExecutorSubscribableChannel.html[ExecutorSubscribableChannel]:
|
||||
* {spring-framework-api}/messaging/support/ExecutorSubscribableChannel.html[ExecutorSubscribableChannel]:
|
||||
`SubscribableChannel` that uses an `Executor` for delivering messages.
|
||||
|
||||
Both the Java configuration (that is, `@EnableWebSocketMessageBroker`) and the XML namespace configuration
|
||||
|
||||
Reference in New Issue
Block a user