Skip to content

Fix broken link for Server-Sent Events #34705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ ServerResponse.async(asyncResponse);
----
======

https://www.w3.org/TR/eventsource/[Server-Sent Events] can be provided via the
https://html.spec.whatwg.org/multipage/server-sent-events.html[Server-Sent Events] can be provided via the
static `sse` method on `ServerResponse`. The builder provided by that method
allows you to send Strings, or other objects as JSON. For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ invokes the configured exception resolvers and completes the request.
=== SSE

`SseEmitter` (a subclass of `ResponseBodyEmitter`) provides support for
https://www.w3.org/TR/eventsource/[Server-Sent Events], where events sent from the server
https://html.spec.whatwg.org/multipage/server-sent-events.html[Server-Sent Events], where events sent from the server
are formatted according to the W3C SSE specification. To produce an SSE
stream from a controller, return `SseEmitter`, as the following example shows:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,6 +49,7 @@
* @author Kazuki Shimizu
* @author Sam Brannen
* @author Hyoungjune Kim
* @author Taeik Lim
* @since 3.0
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">
* HTTP 1.1: Semantics and Content, section 3.1.1.1</a>
Expand Down Expand Up @@ -308,7 +309,7 @@ public class MediaType extends MimeType implements Serializable {
/**
* Media type for {@code text/event-stream}.
* @since 4.3.6
* @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events W3C recommendation</a>
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
*/
public static final MediaType TEXT_EVENT_STREAM;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,10 +30,11 @@
*
* @author Sebastien Deleuze
* @author Arjen Poutsma
* @author Taeik Lim
* @since 5.0
* @param <T> the type of data that this event contains
* @see ServerSentEventHttpMessageWriter
* @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events W3C recommendation</a>
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
*/
public final class ServerSentEvent<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @author Taeik Lim
* @since 5.0
*/
public abstract class BodyInserters {
Expand Down Expand Up @@ -241,7 +242,7 @@ public static <T extends Resource> BodyInserter<T, ReactiveHttpOutputMessage> fr
* @param eventsPublisher the {@code ServerSentEvent} publisher to write to the response body
* @param <T> the type of the data elements in the {@link ServerSentEvent}
* @return the inserter to write a {@code ServerSentEvent} publisher
* @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events W3C recommendation</a>
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
*/
// Parameterized for server-side use
public static <T, S extends Publisher<ServerSentEvent<T>>> BodyInserter<S, ServerHttpResponse> fromServerSentEvents(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,6 +55,7 @@
* {@linkplain HandlerFilterFunction filter function}.
*
* @author Arjen Poutsma
* @author Taeik Lim
* @since 5.2
*/
public interface ServerResponse {
Expand Down Expand Up @@ -284,7 +285,7 @@ static ServerResponse async(Object asyncResponse, Duration timeout) {
* @param consumer consumer that will be provided with an event builder
* @return the server-side event response
* @since 5.3.2
* @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events</a>
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
*/
static ServerResponse sse(Consumer<SseBuilder> consumer) {
return SseServerResponse.create(consumer, null);
Expand Down Expand Up @@ -314,7 +315,7 @@ static ServerResponse sse(Consumer<SseBuilder> consumer) {
* @param timeout maximum time period to wait before timing out
* @return the server-side event response
* @since 5.3.2
* @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events</a>
* @see <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>
*/
static ServerResponse sse(Consumer<SseBuilder> consumer, Duration timeout) {
return SseServerResponse.create(consumer, timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@

/**
* Implementation of {@link ServerResponse} for sending
* <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events</a>.
* <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>.
*
* @author Arjen Poutsma
* @author Sebastien Deleuze
* @author Taeik Lim
* @since 5.3.2
*/
final class SseServerResponse extends AbstractServerResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,12 +35,13 @@

/**
* A specialization of {@link ResponseBodyEmitter} for sending
* <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events</a>.
* <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>.
*
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @author Sam Brannen
* @author Brian Clozel
* @author Taeik Lim
* @since 4.2
*/
public class SseEmitter extends ResponseBodyEmitter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,9 +31,10 @@

/**
* A TransportHandler for sending messages via Server-Sent Events:
* <a href="https://dev.w3.org/html5/eventsource/">https://dev.w3.org/html5/eventsource/</a>.
* <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">Server-Sent Events</a>.
*
* @author Rossen Stoyanchev
* @author Taeik Lim
* @since 4.0
*/
public class EventSourceTransportHandler extends AbstractHttpSendingTransportHandler {
Expand Down