Merge branch '6.2.x'
This commit is contained in:
commit
e9c4665a80
|
@ -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
|
static `sse` method on `ServerResponse`. The builder provided by that method
|
||||||
allows you to send Strings, or other objects as JSON. For example:
|
allows you to send Strings, or other objects as JSON. For example:
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ invokes the configured exception resolvers and completes the request.
|
||||||
=== SSE
|
=== SSE
|
||||||
|
|
||||||
`SseEmitter` (a subclass of `ResponseBodyEmitter`) provides support for
|
`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
|
are formatted according to the W3C SSE specification. To produce an SSE
|
||||||
stream from a controller, return `SseEmitter`, as the following example shows:
|
stream from a controller, return `SseEmitter`, as the following example shows:
|
||||||
|
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -308,7 +308,7 @@ public class MediaType extends MimeType implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Media type for {@code text/event-stream}.
|
* Media type for {@code text/event-stream}.
|
||||||
* @since 4.3.6
|
* @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;
|
public static final MediaType TEXT_EVENT_STREAM;
|
||||||
|
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
* @param <T> the type of data that this event contains
|
* @param <T> the type of data that this event contains
|
||||||
* @see ServerSentEventHttpMessageWriter
|
* @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> {
|
public final class ServerSentEvent<T> {
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ public abstract class BodyInserters {
|
||||||
* @param eventsPublisher the {@code ServerSentEvent} publisher to write to the response body
|
* @param eventsPublisher the {@code ServerSentEvent} publisher to write to the response body
|
||||||
* @param <T> the type of the data elements in the {@link ServerSentEvent}
|
* @param <T> the type of the data elements in the {@link ServerSentEvent}
|
||||||
* @return the inserter to write a {@code ServerSentEvent} publisher
|
* @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
|
// Parameterized for server-side use
|
||||||
public static <T, S extends Publisher<ServerSentEvent<T>>> BodyInserter<S, ServerHttpResponse> fromServerSentEvents(
|
public static <T, S extends Publisher<ServerSentEvent<T>>> BodyInserter<S, ServerHttpResponse> fromServerSentEvents(
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -284,7 +284,7 @@ public interface ServerResponse {
|
||||||
* @param consumer consumer that will be provided with an event builder
|
* @param consumer consumer that will be provided with an event builder
|
||||||
* @return the server-side event response
|
* @return the server-side event response
|
||||||
* @since 5.3.2
|
* @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) {
|
static ServerResponse sse(Consumer<SseBuilder> consumer) {
|
||||||
return SseServerResponse.create(consumer, null);
|
return SseServerResponse.create(consumer, null);
|
||||||
|
@ -314,7 +314,7 @@ public interface ServerResponse {
|
||||||
* @param timeout maximum time period to wait before timing out
|
* @param timeout maximum time period to wait before timing out
|
||||||
* @return the server-side event response
|
* @return the server-side event response
|
||||||
* @since 5.3.2
|
* @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) {
|
static ServerResponse sse(Consumer<SseBuilder> consumer, Duration timeout) {
|
||||||
return SseServerResponse.create(consumer, timeout);
|
return SseServerResponse.create(consumer, timeout);
|
||||||
|
|
|
@ -46,7 +46,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link ServerResponse} for sending
|
* 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 Arjen Poutsma
|
||||||
* @author Sebastien Deleuze
|
* @author Sebastien Deleuze
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialization of {@link ResponseBodyEmitter} for sending
|
* 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 Rossen Stoyanchev
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -31,7 +31,7 @@ import org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A TransportHandler for sending messages via Server-Sent Events:
|
* 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 Rossen Stoyanchev
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
|
|
Loading…
Reference in New Issue