Skip to content

Commit 5cb4985

Browse files
committed
Merge branch '6.1.x'
2 parents 19792f9 + 89ce63f commit 5cb4985

File tree

14 files changed

+32
-32
lines changed

14 files changed

+32
-32
lines changed

framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
A common requirement for REST services is to include details in the body of error
77
responses. The Spring Framework supports the "Problem Details for HTTP APIs"
8-
specification, {rfc-site}/rfc7807.html[RFC 7807].
8+
specification, {rfc-site}/rfc9457.html[RFC 9457].
99

1010
The following are the main abstractions for this support:
1111

12-
- `ProblemDetail` -- representation for an RFC 7807 problem detail; a simple container
12+
- `ProblemDetail` -- representation for an RFC 9457 problem detail; a simple container
1313
for both standard fields defined in the spec, and for non-standard ones.
1414
- `ErrorResponse` -- contract to expose HTTP error response details including HTTP
15-
status, response headers, and a body in the format of RFC 7807; this allows exceptions to
15+
status, response headers, and a body in the format of RFC 9457; this allows exceptions to
1616
encapsulate and expose the details of how they map to an HTTP response. All Spring WebFlux
1717
exceptions implement this.
1818
- `ErrorResponseException` -- basic `ErrorResponse` implementation that others
@@ -28,7 +28,7 @@ and any `ErrorResponseException`, and renders an error response with a body.
2828
[.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-render[See equivalent in the Servlet stack]#
2929

3030
You can return `ProblemDetail` or `ErrorResponse` from any `@ExceptionHandler` or from
31-
any `@RequestMapping` method to render an RFC 7807 response. This is processed as follows:
31+
any `@RequestMapping` method to render an RFC 9457 response. This is processed as follows:
3232

3333
- The `status` property of `ProblemDetail` determines the HTTP status.
3434
- The `instance` property of `ProblemDetail` is set from the current URL path, if not
@@ -37,7 +37,7 @@ already set.
3737
"application/problem+json" over "application/json" when rendering a `ProblemDetail`,
3838
and also falls back on it if no compatible media type is found.
3939

40-
To enable RFC 7807 responses for Spring WebFlux exceptions and for any
40+
To enable RFC 9457 responses for Spring WebFlux exceptions and for any
4141
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an
4242
xref:web/webflux/controller/ann-advice.adoc[@ControllerAdvice] in Spring configuration. The handler
4343
has an `@ExceptionHandler` method that handles any `ErrorResponse` exception, which
@@ -54,7 +54,7 @@ any RFC 7807 response and take some action.
5454
== Non-Standard Fields
5555
[.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-non-standard[See equivalent in the Servlet stack]#
5656

57-
You can extend an RFC 7807 response with non-standard fields in one of two ways.
57+
You can extend an RFC 9457 response with non-standard fields in one of two ways.
5858

5959
One, insert into the "properties" `Map` of `ProblemDetail`. When using the Jackson
6060
library, the Spring Framework registers `ProblemDetailJacksonMixin` that ensures this

framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ generally supported for all return values.
2424
| For returning a response with headers and no body.
2525

2626
| `ErrorResponse`
27-
| To render an RFC 7807 error response with details in the body,
27+
| To render an RFC 9457 error response with details in the body,
2828
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]
2929

3030
| `ProblemDetail`
31-
| To render an RFC 7807 error response with details in the body,
31+
| To render an RFC 9457 error response with details in the body,
3232
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]
3333

3434
| `String`

framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
A common requirement for REST services is to include details in the body of error
77
responses. The Spring Framework supports the "Problem Details for HTTP APIs"
8-
specification, {rfc-site}/rfc7807[RFC 7807].
8+
specification, {rfc-site}/rfc9457[RFC 9457].
99

1010
The following are the main abstractions for this support:
1111

12-
- `ProblemDetail` -- representation for an RFC 7807 problem detail; a simple container
12+
- `ProblemDetail` -- representation for an RFC 9457 problem detail; a simple container
1313
for both standard fields defined in the spec, and for non-standard ones.
1414
- `ErrorResponse` -- contract to expose HTTP error response details including HTTP
15-
status, response headers, and a body in the format of RFC 7807; this allows exceptions to
15+
status, response headers, and a body in the format of RFC 9457; this allows exceptions to
1616
encapsulate and expose the details of how they map to an HTTP response. All Spring MVC
1717
exceptions implement this.
1818
- `ErrorResponseException` -- basic `ErrorResponse` implementation that others
@@ -28,7 +28,7 @@ and any `ErrorResponseException`, and renders an error response with a body.
2828
[.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-render[See equivalent in the Reactive stack]#
2929

3030
You can return `ProblemDetail` or `ErrorResponse` from any `@ExceptionHandler` or from
31-
any `@RequestMapping` method to render an RFC 7807 response. This is processed as follows:
31+
any `@RequestMapping` method to render an RFC 9457 response. This is processed as follows:
3232

3333
- The `status` property of `ProblemDetail` determines the HTTP status.
3434
- The `instance` property of `ProblemDetail` is set from the current URL path, if not
@@ -37,7 +37,7 @@ already set.
3737
"application/problem+json" over "application/json" when rendering a `ProblemDetail`,
3838
and also falls back on it if no compatible media type is found.
3939

40-
To enable RFC 7807 responses for Spring WebFlux exceptions and for any
40+
To enable RFC 9457 responses for Spring WebFlux exceptions and for any
4141
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an
4242
xref:web/webmvc/mvc-controller/ann-advice.adoc[@ControllerAdvice] in Spring configuration. The handler
4343
has an `@ExceptionHandler` method that handles any `ErrorResponse` exception, which
@@ -54,7 +54,7 @@ any RFC 7807 response and take some action.
5454
== Non-Standard Fields
5555
[.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-non-standard[See equivalent in the Reactive stack]#
5656

57-
You can extend an RFC 7807 response with non-standard fields in one of two ways.
57+
You can extend an RFC 9457 response with non-standard fields in one of two ways.
5858

5959
One, insert into the "properties" `Map` of `ProblemDetail`. When using the Jackson
6060
library, the Spring Framework registers `ProblemDetailJacksonMixin` that ensures this

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ level, xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[HandlerExceptionResolv
228228
See xref:web/webmvc/mvc-controller/ann-methods/responseentity.adoc[ResponseEntity].
229229

230230
| `ErrorResponse`
231-
| To render an RFC 7807 error response with details in the body,
231+
| To render an RFC 9457 error response with details in the body,
232232
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
233233

234234
| `ProblemDetail`
235-
| To render an RFC 7807 error response with details in the body,
235+
| To render an RFC 9457 error response with details in the body,
236236
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
237237

238238
| `String`

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ supported for all return values.
2323
| For returning a response with headers and no body.
2424

2525
| `ErrorResponse`
26-
| To render an RFC 7807 error response with details in the body,
26+
| To render an RFC 9457 error response with details in the body,
2727
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
2828

2929
| `ProblemDetail`
30-
| To render an RFC 7807 error response with details in the body,
30+
| To render an RFC 9457 error response with details in the body,
3131
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
3232

3333
| `String`

spring-web/src/main/java/org/springframework/http/MediaType.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public class MediaType extends MimeType implements Serializable {
185185
/**
186186
* Public constant media type for {@code application/problem+json}.
187187
* @since 5.0
188-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
188+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+json">
189189
* Problem Details for HTTP APIs, 6.1. application/problem+json</a>
190190
*/
191191
public static final MediaType APPLICATION_PROBLEM_JSON;
@@ -199,7 +199,7 @@ public class MediaType extends MimeType implements Serializable {
199199
/**
200200
* Public constant media type for {@code application/problem+json}.
201201
* @since 5.0
202-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
202+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+json">
203203
* Problem Details for HTTP APIs, 6.1. application/problem+json</a>
204204
* @deprecated as of 5.2 in favor of {@link #APPLICATION_PROBLEM_JSON}
205205
* since major browsers like Chrome
@@ -225,7 +225,7 @@ public class MediaType extends MimeType implements Serializable {
225225
/**
226226
* Public constant media type for {@code application/problem+xml}.
227227
* @since 5.0
228-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.2">
228+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+xml">
229229
* Problem Details for HTTP APIs, 6.2. application/problem+xml</a>
230230
*/
231231
public static final MediaType APPLICATION_PROBLEM_XML;

spring-web/src/main/java/org/springframework/http/ProblemDetail.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.util.ObjectUtils;
2727

2828
/**
29-
* Representation for an RFC 7807 problem detail. Includes spec-defined
29+
* Representation for an RFC 9457 problem detail. Includes spec-defined
3030
* properties, and a {@link #getProperties() properties} map for additional,
3131
* non-standard properties.
3232
*
@@ -45,7 +45,7 @@
4545
* @author Rossen Stoyanchev
4646
* @author Juergen Hoeller
4747
* @since 6.0
48-
* @see <a href="https://datatracker.ietf.org/doc/html/rfc7807">RFC 7807</a>
48+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9457">RFC 9457</a>
4949
* @see org.springframework.web.ErrorResponse
5050
* @see org.springframework.web.ErrorResponseException
5151
*/

spring-web/src/main/java/org/springframework/web/ErrorResponse.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.springframework.lang.Nullable;
2828

2929
/**
30-
* Representation of a complete RFC 7807 error response including status,
31-
* headers, and an RFC 7807 formatted {@link ProblemDetail} body. Allows any
30+
* Representation of a complete RFC 9457 error response including status,
31+
* headers, and an RFC 9457 formatted {@link ProblemDetail} body. Allows any
3232
* exception to expose HTTP error response information.
3333
*
3434
* <p>{@link ErrorResponseException} is a default implementation of this
@@ -58,7 +58,7 @@ default HttpHeaders getHeaders() {
5858
}
5959

6060
/**
61-
* Return the body for the response, formatted as an RFC 7807
61+
* Return the body for the response, formatted as an RFC 9457
6262
* {@link ProblemDetail} whose {@link ProblemDetail#getStatus() status}
6363
* should match the response status.
6464
*/

spring-web/src/main/java/org/springframework/web/ErrorResponseException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* {@link RuntimeException} that implements {@link ErrorResponse} to expose
29-
* an HTTP status, response headers, and a body formatted as an RFC 7807
29+
* an HTTP status, response headers, and a body formatted as an RFC 9457
3030
* {@link ProblemDetail}.
3131
*
3232
* <p>The exception can be used as is, or it can be extended as a more specific

spring-web/src/main/java/org/springframework/web/multipart/support/MissingServletRequestPartException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public HttpStatusCode getStatusCode() {
7575
}
7676

7777
/**
78-
* Return the body for the response, formatted as an RFC 7807
78+
* Return the body for the response, formatted as an RFC 9457
7979
* {@link ProblemDetail} whose {@link ProblemDetail#getStatus() status}
8080
* should match the response status.
8181
*/

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParame
217217
throw ex;
218218
}
219219

220-
// For ProblemDetail, fall back on RFC 7807 format
220+
// For ProblemDetail, fall back on RFC 9457 format
221221
if (bestMediaType == null && ProblemDetail.class.isAssignableFrom(elementType.toClass())) {
222222
bestMediaType = selectMediaType(exchange, () -> getMediaTypesFor(elementType), this.problemMediaTypes);
223223
}

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/**
5151
* A class with an {@code @ExceptionHandler} method that handles all Spring
5252
* WebFlux raised exceptions by returning a {@link ResponseEntity} with
53-
* RFC 7807 formatted error details in the body.
53+
* RFC 9457 formatted error details in the body.
5454
*
5555
* <p>Convenient as a base class of an {@link ControllerAdvice @ControllerAdvice}
5656
* for global exception handling in an application. Subclasses can override

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected <T> void writeWithMessageConverters(@Nullable T value, MethodParameter
276276
List<MediaType> compatibleMediaTypes = new ArrayList<>();
277277
determineCompatibleMediaTypes(acceptableTypes, producibleTypes, compatibleMediaTypes);
278278

279-
// For ProblemDetail, fall back on RFC 7807 format
279+
// For ProblemDetail, fall back on RFC 9457 format
280280
if (compatibleMediaTypes.isEmpty() && ProblemDetail.class.isAssignableFrom(valueType)) {
281281
determineCompatibleMediaTypes(this.problemMediaTypes, producibleTypes, compatibleMediaTypes);
282282
}

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
/**
6060
* A class with an {@code @ExceptionHandler} method that handles all Spring MVC
61-
* raised exceptions by returning a {@link ResponseEntity} with RFC 7807
61+
* raised exceptions by returning a {@link ResponseEntity} with RFC 9457
6262
* formatted error details in the body.
6363
*
6464
* <p>Convenient as a base class of an {@link ControllerAdvice @ControllerAdvice}

0 commit comments

Comments
 (0)