Commit Graph

3017 Commits

Author SHA1 Message Date
Sam Brannen
01fea5e7ed Polish Jackson 3 support
- Improve Javadoc.

- Suppress warnings for "removal".

- Update copyright headers.

- Migrate several tests from:
  - MappingJackson2MessageConverter to JacksonJsonMessageConverter
  - Jackson2JsonEncoder to JacksonJsonEncoder
  - Jackson2JsonDecoder to JacksonJsonDecoder
  - Jackson2SmileEncoder to JacksonSmileEncoder
  - Jackson2ObjectMapperBuilder to JsonMapper and XmlMapper
  - MappingJackson2JsonView to JacksonJsonView
  - MappingJackson2HttpMessageConverter to JacksonJsonHttpMessageConverter
  - MappingJackson2XmlHttpMessageConverter to JacksonXmlHttpMessageConverter
2025-05-14 16:55:27 +02:00
Sébastien Deleuze
2a29e16456 Deprecate for removal Jackson 2 support
This commit deprecate for removal (likely in a future 7.x release) the
Jackson 2 support in favor of the Jackson 3 one.

Closes gh-33798
2025-05-13 18:02:33 +02:00
Sébastien Deleuze
7acd4aec38 Introduce Jackson 3 support to AnnotationDrivenBeanDefinitionParser
See gh-33798
2025-05-13 17:53:29 +02:00
Sébastien Deleuze
d0cd7af7e6 Introduce hints support in advices
This commit introduces RequestBodyAdvice#determineReadHints and
ResponseBodyAdvice#determineWriteHints in order to be able to support
SmartHttpMessageConverter hints, as well as related `@JsonView`
support.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze
71987a8713 Introduce Jackson 3 support for views
This commit introduces Jackson 3 based variants of the following
Jackson 2 classes (and related dependent classes).

MappingJackson2JsonView -> JacksonJsonView
MappingJackson2XmlView-> JacksonXmlView

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze
d4e4a9ae06 Introduce Jackson 3 support for converters
This commit introduces Jackson 3 SmartHttpMessageConverter based
variants of the following Jackson 2 classes (and related dependent classes).

org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter ->
org.springframework.http.converter.AbstractJacksonHttpMessageConverter

MappingJackson2HttpMessageConverter -> JacksonJsonHttpMessageConverter
MappingJackson2SmileHttpMessageConverter -> JacksonSmileHttpMessageConverter
MappingJackson2CborHttpMessageConverter -> JacksonCborHttpMessageConverter
MappingJackson2XmlHttpMessageConverter -> JacksonXmlHttpMessageConverter
MappingJackson2YamlHttpMessageConverter -> JacksonYamlHttpMessageConverter

They use hints instead of MappingJacksonValue and MappingJacksonInputMessage
to support `@JsonView` and FilterProvider.

Jackson 3 support is configured if found in the classpath otherwise
fallback to Jackson 2.

JacksonHandlerInstantiator needs to be enabled explicitly if needed.

See gh-33798
2025-05-13 17:53:28 +02:00
rstoyanchev
d8b05c7eba Merge branch '6.2.x' 2025-04-16 11:59:28 +01:00
rstoyanchev
9c13c6b695 Revert "Use optimistic locking where possible in ResponseBodyEmitter"
This reverts commit e67f892e44.

Closes gh-34762
2025-04-16 11:53:22 +01:00
rstoyanchev
b49924ba37 Revert "Fix handling of timeout in SseEmitter"
This reverts commit f92f9c1d5b.

See gh-34762
2025-04-16 11:41:00 +01:00
Sam Brannen
23aea5c402 Merge branch '6.2.x' 2025-04-14 11:32:48 +02:00
Sam Brannen
a22d204681 Remove duplicate words in Java source code
Discovered using regular expression: \b(\w+)\s+\1\b[^(}]
2025-04-14 11:24:55 +02:00
Sam Brannen
df4868bf83 Merge branch '6.2.x' 2025-04-10 16:49:43 +02:00
Sam Brannen
cd987fc104 Update Javadoc to stop mentioning 5.3.x as the status quo
Closes gh-34740
2025-04-10 16:40:04 +02:00
Sébastien Deleuze
eee45c3583 Refine CORS preflight requests handling with no configuration
This commit makes CORS preflight requests handling more flexible
by just skipping setting CORS response headers when no
configuration is defined instead of rejecting them.

That will have the same effect on user agent side (the preflight
request will be considered as not authorized and the actual
request not performed) but is more flexible and more efficient.

Closes gh-31839
2025-04-04 21:32:38 +02:00
Juergen Hoeller
907c1db7a6 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
2025-04-04 00:28:50 +02:00
Juergen Hoeller
ee804ee8fb Avoid throwing of plain RuntimeException 2025-04-04 00:22:24 +02:00
Sébastien Deleuze
e9c4665a80 Merge branch '6.2.x' 2025-04-02 18:05:04 +02:00
Taeik Lim
a946fe2bf8 Fix broken link for Server-Sent Events
Signed-off-by: Taeik Lim <sibera21@gmail.com>
Closes gh-34705
2025-04-02 17:43:42 +02:00
Juergen Hoeller
a122dda596 Merge branch '6.2.x' 2025-03-31 16:42:29 +02:00
Juergen Hoeller
743f32675d Only attempt load for CGLIB classes in AOT mode
Closes gh-34677
2025-03-31 16:39:18 +02:00
rstoyanchev
779f1b080e Merge branch '6.2.x' 2025-03-31 11:36:44 +01:00
rstoyanchev
f68fb97e7e Remove outdated notes on forwarded headers.
Closes gh-34625
2025-03-31 11:36:15 +01:00
Sam Brannen
9956cc11bb Merge branch '6.2.x' 2025-03-29 12:57:49 +01:00
Tran Ngoc Nhan
30fcaef813 Remove unnecessary closing curly brackets in Javadoc
Closes gh-34679

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-03-29 12:37:48 +01:00
Juergen Hoeller
47651350f3 Polishing 2025-03-21 10:58:40 +01:00
Sam Brannen
6505c4b839 Refine use of isArray() and componentType() 2025-03-20 17:28:37 +01:00
Sam Brannen
8db1340263 Merge branch '6.2.x' 2025-03-19 16:24:18 +01:00
Sam Brannen
208d52d852 Introduce Checkstyle rule for separator symbol location 2025-03-19 15:35:44 +01:00
rstoyanchev
087d239148 Merge branch '6.2.x' 2025-03-19 12:34:58 +00:00
rstoyanchev
18c3b637e4 Fix dated Javadoc in MvcUriComponentsBuilder
related to forwarded headers

Closes gh-34615
2025-03-19 12:33:01 +00:00
rstoyanchev
34c69bfc67 Allow empty comment in ServerResponse.SseBuilder
Closes gh-34608
2025-03-19 12:14:37 +00:00
Sam Brannen
e05d4f2f18 Merge branch '6.2.x' 2025-03-18 16:42:37 +01:00
Sam Brannen
c6a9aa59a3 Remove BDDMockito Checkstyle rule
This commit removes the BDDMockito Checkstyle rule, since it did not
actually enforce the use of BDDMockito.

This commit also updates static imports to use Mockito instead of
BDDMockito where appropriate (automated via the Eclipse IDE Organize
Imports clean-up task).

Closes gh-34616
2025-03-18 16:35:57 +01:00
rstoyanchev
f8a82b46c1 Fix WebSocketHandlerMapping match for "/*"
Closes gh-34503
2025-03-12 12:29:35 +00:00
rstoyanchev
51d34fff64 API versioning support for Spring MVC
See gh-34566
2025-03-10 13:53:12 +00:00
Sam Brannen
aeaf52ee96 Merge branch '6.2.x' 2025-03-06 17:32:49 +01:00
Sam Brannen
8334cb1abb Revise tests to better express intent 2025-03-06 17:32:32 +01:00
Juergen Hoeller
2fbd54078b Merge branch '6.2.x'
# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceHandlerUtils.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHandlerUtils.java
2025-03-04 18:46:39 +01:00
Juergen Hoeller
403362fe3c Polishing 2025-03-04 18:44:56 +01:00
Juergen Hoeller
534f123fe8 Add explicit FileSystemResource path check for trailing slash
Closes gh-34509
2025-03-04 18:44:25 +01:00
rstoyanchev
33fef8df84 Merge branch '6.2.x' 2025-02-27 14:36:24 +00:00
rstoyanchev
f92f9c1d5b Fix handling of timeout in SseEmitter
Closes gh-34426
2025-02-27 14:34:26 +00:00
Brian Clozel
8b14bf86ef Merge branch '6.2.x' 2025-02-25 10:48:09 +01:00
Brian Clozel
f895d762cd Remove duplicate Content-Type header in error cases
Prior to this commit, the `DispatcherServlet` would try and reset the
response buffer in case of errors, if the response is not committed
already. This allows for more flexible error handling, even if the
response was being handled already when it errored.

Resetting the response buffer clears the body but leaves HTTP response
headers intact. This is done on purpose as to not clear headers
previously added by Servlet Filters. By leaving in place some headers
like "Content-Type", this does not take into account the fact that the
response body was cleared and that error handling will perform another
round of content negotiation. While this isn't a problem for some
Servlet containers which enforce a single "Content-Type" header value,
this can cause multiple/duplicate values for some others.

This commit ensures that the "Content-Type" response header is removed
at the same time as we clear the "producible media types" attribute:
another pass of content negotiation will be performed for error
handling.

Fixes gh-34366
2025-02-25 10:43:19 +01:00
Sébastien Deleuze
b8d9dee7be Refine Kotlin serialization converters/codecs conditions
This commit is a follow-up of 34410 to refine the activation conditions
of Kotlin serialization converters/codecs.

Closes gh-34438
2025-02-17 18:40:05 +01:00
Sam Brannen
8df21109f2 Merge branch '6.2.x' 2025-02-12 17:50:22 +01:00
Sam Brannen
b2134ee71f Avoid Gradle build warnings about @⁠SuppressFBWarnings from FindBugs
In order to avoid Gradle build warnings about @⁠SuppressFBWarnings, this
commit introduces a testCompileOnly dependency on `findbugs` in the
spring-webmvc module so that the class file for @⁠SuppressFBWarnings is
available to the compileTestJava task.

Closes gh-34418
2025-02-12 17:49:23 +01:00
Sam Brannen
de4db3812a Merge branch '6.2.x' 2025-02-12 16:46:58 +01:00
Sam Brannen
440a259b71 Clean up warnings in Gradle build 2025-02-12 16:46:41 +01:00
Brian Clozel
5c09435816 Fix warnings
See gh-34409
2025-02-12 08:48:04 +01:00