Commit Graph

3159 Commits

Author SHA1 Message Date
Sébastien Deleuze eea9130ea6 Fix context class resolution for nested types
This commit introduces ContextClassRequestBodyAdvice which adds a
"contextClass" hint allowing to resolve generics for Optional,
HttpEntity or ServerSentEvent container types.

Closes gh-36111
2026-01-08 16:53:28 +01:00
Sébastien Deleuze d85ac300bb Update JsonView advices Javadoc
Make the documentation relevant for all Jackson converters.
2026-01-08 16:53:19 +01:00
rstoyanchev e0aa116217 Re-initialize API version in each HandlerMapping
Each HandlerMapping may have its own ApiVersionStrategy rules, or may not
have one at all. This change ensures independent decisions.

See gh-36059
2026-01-08 09:32:34 +00:00
rstoyanchev 05b98b0a32 Suppress API version errors on ERROR dispatch
While an API version may be important for mapping in an ERROR dispatch,
it is more important to allow the original exception to be handled.

Closes gh-36058
2026-01-07 16:00:40 +00:00
rstoyanchev a9027ddf76 Refine handling of API version errors
Among HandlerMapping's some may not expect an API version. This is why
those that do must be careful not to raise API validation errors if
they don't match the request.

Closes gh-36059
2026-01-07 16:00:39 +00:00
木葉 Scarlet d077e043d6 Consistently declare @⁠Nullable on parameter in equals() implementations
Closes gh-36075

Signed-off-by: 木葉 Scarlet <93977077+mukjepscarlet@users.noreply.github.com>
2025-12-29 11:43:49 +02:00
Juergen Hoeller c813577908 Consistently use DefaultParameterNameDiscoverer.getSharedInstance()
This includes MethodParameter resolving getParameterName() by default now.
initParameterNameDiscovery(null) can be used to suppress such resolution.

Closes gh-36024
2025-12-17 13:39:02 +01:00
Sébastien Deleuze d4e4250bb1 Remove JavaScript/Kotlin from ScriptEngine documentation
Closes gh-27919
2025-12-15 18:43:09 +01:00
rstoyanchev 0eefac21c9 Polishing contribution
Closes gh-35758
2025-12-10 18:17:12 +00:00
Samuel Gulliksson e99791f289 Improve i18n-support for NoResourceFoundException.
Return the requested resource as ErrorResponse.getDetailMessageArguments,
making it usable with message customization and i18n.

See gh-35758

Signed-off-by: Samuel Gulliksson <samuel.gulliksson@gmail.com>
2025-12-10 18:17:12 +00:00
Juergen Hoeller 07c0213f20 Polishing 2025-12-04 00:12:31 +01:00
rstoyanchev 15c16d2c3a FragmentsRendering exposes its fragments
Closes gh-35775
2025-12-01 11:17:40 +00:00
Juergen Hoeller c6810334ca Move extended web data binders to common support packages
This resolves cyclic dependencies between function and annotation-based packages.

See gh-35800
2025-11-30 11:31:04 +01:00
rstoyanchev a9a404266c Data binding from pathvars and headers in fn handlers
Closes gh-35800
2025-11-26 12:30:48 +00:00
rstoyanchev b29f4ed37e Minor refactoring in DefaultServerRequest
Ensure bind logic is shared across DefaultServerRequest and
BuiltServerRequest.

See gh-35800
2025-11-26 12:30:48 +00:00
rstoyanchev 4847ee80b0 Add required type to TypeMismatchException message args
Closes gh-35837
2025-11-26 12:30:48 +00:00
Sébastien Deleuze 2641b5d783 Polishing
See gh-35861
2025-11-26 10:27:01 +01:00
Vincent Potucek 83bbf16e6c Modernize java.time API usages
See gh-35861
Signed-off-by: Vincent Potucek <vpotucek@me.com>
2025-11-26 10:24:34 +01:00
rstoyanchev fb8bbe838d Polishing in RouterFunctions
See gh-35791
2025-11-12 10:52:04 +00:00
rstoyanchev dff0858340 Update generics on WebMvc RouterFunctions.Builder
Same as 7555d0e489, but for WebMvc.

Closes gh-35791
2025-11-12 08:07:36 +00:00
Juergen Hoeller 15a3f425cb Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
2025-11-11 15:42:11 +01:00
Juergen Hoeller 5c5367a1be Polishing 2025-11-11 15:40:08 +01:00
Sam Brannen c6b4b43076 Merge branch '6.2.x' 2025-11-10 15:39:18 +01:00
Sam Brannen 335a2c4e21 Support response encoding in select and options JSP form tags
Prior to this commit, Spring Framework's JSP form tags supported the
response encoding in most places; however, <form:select> and
<form:options> still did not support the response character encoding.

To address that, this commit updates SelectTag, OptionsTag, and
OptionWriter to provide support for response character encoding in the
`select` and `options` JSP form tags.

See gh-33023
Closes gh-35783
2025-11-10 15:35:13 +01:00
Sébastien Deleuze d64edc01c0 Prevent Kotlin Serialization converters side effects
This commit updates Kotlin serialization converters to perform
an additional check invoking
KotlinDetector#hasSerializableAnnotation to decide if the
related type should be processed or not.

The goal is to prevent in the default arrangement conflicts
between general purpose converters like Jackson and
Kotlin serialization when both are used.

New constructors allowing to specify a custom predicate
are also introduced.

See gh-35761
2025-11-10 11:35:44 +01:00
rstoyanchev b128f59714 Expose handler to ApiVersionDeprecationHandler implementations
Closes gh-35750
2025-11-05 12:23:59 +00:00
rstoyanchev 183a9466c5 Add dedicated ApiVersionResolver implementations
Closes gh-35747
2025-11-03 09:19:38 +00:00
Brian Clozel af026c0373 Review HttpMessageConverters semantics in Builder
Prior to this commit, the `HttpMessageConverters` builder API had
methods like "jsonMessageConverter" for configuring a specific converter
for JSON support. This converter would be always configured at a given
position, even if default converters registration is not requested.
On the other hand, `customMessageConverter` would add any converter
ahead of the list, in all cases. This difference was not conveyed as it
should by the API.

This commit makes the following changes:

* builder methods are renamed to `withJsonConverter` and variants, to
  better convey the fact that those are replacing the default converter
  for a given format.
* `customMessageConverter` is renamed to `addCustomConverter` to better
  reflect the additive aspect.
* the JavaDoc has been updated accordingly
* `withJsonConverter` and others are now only effective if the default
  registration of auto-detected converters is requested. This better
  aligns with the behavior in the reactive codecs configuration

Closes gh-35704
2025-10-31 17:18:28 +01:00
Sébastien Deleuze 7509e257d1 Remove outdated Portlet mentions
Closes gh-35726
2025-10-30 16:02:15 +01:00
rstoyanchev b5557160e0 Merge branch '6.2.x' 2025-10-30 12:24:39 +00:00
rstoyanchev 715bc68c16 Rename methods in FragmentsRendering
Previous commit 81ea35c726 in main for 7.0
should have been applied in 6.2.x first for 6.2.1.

This commit applies the changes in 6.2.x as intended,
effective as of 6.2.13.

Closes gh-33974
2025-10-30 12:17:51 +00:00
Sébastien Deleuze 694224f1a6 Remove outdated Spring version mentions
Close gh-35696
2025-10-28 13:58:09 +01:00
Juergen Hoeller 7adcd99ea2 Polishing 2025-10-21 00:59:56 +02:00
Juergen Hoeller 7ca2a5dec5 Early support for Jakarta Servlet 6.2 and Jakarta Activation 2.2
Closes gh-35670
2025-10-21 00:42:03 +02:00
Juergen Hoeller 527643f142 Merge branch '6.2.x' 2025-10-15 19:41:20 +02:00
Juergen Hoeller c53132ecdf Polishing 2025-10-15 19:40:09 +02:00
Brian Clozel e6481a011b Deprecate "feed" and "document" view packages
Prior to this commit, Spring Framework would ship several abstract
`*View` implementations for rendering PDF, RSS or XLS documents using
well-known libraries. More recently, supporting libraries evolved a lot
with new versions and forks. Spring Framework is not in a position to
efficiently support all variants within the project.

This commit deprecates the relevant classes. Instead, libraries can
reuse existing code and ship optional support for Spring directly.
Often, updating imports and library usage is enough.
As an alternative, applications can decide to perform rendering
direclty in web handlers.

Closes gh-35451
2025-10-15 16:36:24 +02:00
Sébastien Deleuze 8ec9ab6698 Add builder-based constructors to Jackson 3 infrastructure
This commit also polishes documentation, constructor parameter and
field names.

Closes gh-35597
2025-10-15 11:49:55 +02:00
rstoyanchev 43c13ca043 Polishing contribution
Closes gh-35348
2025-10-14 11:37:40 +01:00
秦利斌 17cf2ad457 MvcUriComponentsBuilder resolves embedded values
See gh-35348

Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-10-14 11:37:24 +01:00
Sam Brannen 0389684429 Revise contribution
See gh-35352
2025-10-11 19:37:34 +02:00
yongjunhong 8edc7cd542 Reject effectively private handler methods on CGLIB proxied controllers
This commit rejects the invocation of an effectively private handler
method on a CGLIB proxied controller for both Spring MVC and Spring
WebFlux.

Closes gh-35352

Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Signed-off-by: Yongjun Hong <kevin0928@naver.com>
Signed-off-by: yongjunhong <yongjunh@apache.org>
2025-10-11 19:27:06 +02:00
Sam Brannen 19b4021d26 Polish tests 2025-10-10 18:45:20 +02:00
Juergen Hoeller edc14c2e15 Merge branch '6.2.x'
# Conflicts:
#	spring-context-indexer/src/main/java/org/springframework/context/index/processor/StandardStereotypesProvider.java
#	spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java
#	spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java
2025-10-09 20:37:49 +02:00
Juergen Hoeller c2a66e723f Polishing 2025-10-09 20:34:03 +02:00
Sam Brannen 48ec990a17 Fix typos 2025-10-01 11:53:01 +02:00
Sam Brannen 8dd64602e8 Avoid warnings with AssertJ APIs 2025-09-29 17:11:42 +02:00
rstoyanchev 2e915a3934 Provide access to API version in controller method
Closes gh-35424
2025-09-26 17:32:38 +01:00
Manu Sridharan e834a3a80c Nullability fixes for AtomicReference variables
Closes gh-35514
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2025-09-25 07:39:44 +02:00
Sam Brannen 051adf267f Introduce MapAccessor in SpEL and deprecate existing implementation
Prior to this commit, the MapAccessor for SpEL resided in the
org.springframework.context.expression package in the spring-context
module; however, it arguably should reside in the spring-expression
module so that it can be used whenever SpEL is used (without requiring
spring-context).

This commit therefore officially deprecates the MapAccessor in
spring-context for removal in favor of a new copy of the implementation
in the org.springframework.expression.spel.support package in the
spring-expression module.

Closes gh-35537
2025-09-24 16:52:27 +02:00