Commit Graph

2057 Commits

Author SHA1 Message Date
dogglezz 503ccb577c Remove unused imports
Closes gh-31851
2023-12-15 09:35:17 +01:00
Sébastien Deleuze a01c6d57bb Inherit parent context in coRouter DSL
This commit also allows context override, as it
is useful for the nested router use case.

Closes gh-31831
2023-12-13 16:00:22 +01:00
Sam Brannen c0683cd30b Update copyright headers 2023-12-12 14:51:03 +01:00
Sam Brannen 7471fd1dd0 Remove obsolete code 2023-12-12 14:51:03 +01:00
Brian Clozel b87852612b Improve "active" metrics handling in WebClient observations
Prior to this commit, the WebClient observations would have a specific
lifecycle where the observation context is build with a
`ClientRequest.Builder` as tracing needs to add an outgoing request
header before the request is made immutable.

With this setup, the metrics observation handler processes the start
event by increasing the "http.client.requests.active" counter and
collecting tags at this point. Because then the immutable request is not
yet fully built or set on the context, the keyvalues collected by the
observation convention at that point can be incomplete.

This commit ensures that a request is always made available in the
context, even if it is updated right after the observation start. The
only difference between the two should be additional tracing headers and
a request attribute holding the current observation context.

Closes gh-31702
2023-12-12 14:41:41 +01:00
Sébastien Deleuze aabe4d0b07 Pickup CoroutineContext saved by CoWebFilter in coRouter
Closes gh-31793
2023-12-11 19:03:35 +01:00
Sébastien Deleuze 91b9a75371 Box Kotlin value class parameters in web endpoint
In order to avoid "java.lang.IllegalArgumentException:
object is not an instance of declaring class" errors.

Closes gh-31698
2023-12-08 15:27:08 +01:00
Rossen Stoyanchev 2e07f9ab33 DefaultWebClient exposes full URI template as request attribute
Closes gh-30027
2023-12-07 12:16:22 +00:00
Arjen Poutsma ef4ffa0005 Support empty part in DefaultPartHttpMessageReader
This commit fixes a bug in DefaultPartHttpMessageReader's
MultipartParser, due to which the last token in a part window was not
properly indicated.

Closes gh-30953
2023-12-06 12:21:37 +01:00
Yanming Zhou afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou 7b16ef90f1 Replace assertThat(x.equals(y)) with assertThat(x).isEqualTo(y)
Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isTrue\(\)
Replace with : assertThat($1).isEqualTo($2)

Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isFalse\(\)
Replace with : assertThat($1).isNotEqualTo($2)

Closes gh-31763
2023-12-06 09:50:15 +01:00
Yanming Zhou 59815cefce Replace assertThat(x.get(i)). with assertThat(x).element(i).
Search for   : assertThat\((.+)\.get\((\d+)\)\)\.
Replace with : assertThat($1).element($2).

Closes gh-31759
2023-12-06 09:43:59 +01:00
Yanming Zhou 785ad399e9 Replace assertThat(x.iterator().next()) with assertThat(x).element(0)
Search for   : assertThat\((.+).iterator\(\).next\(\)\)
Replace with : assertThat($1).element(0)
2023-12-06 10:52:39 +08:00
Arjen Poutsma 52d4b83dba Partially revert RequestPredicates attribute handling
This commit partially reverts 39786e4790
and c5c843696b, as the approach taken did
not take into account request predicates that query request attributes,
including path variables.

Closes gh-31732
2023-12-05 12:30:15 +01:00
Yanming Zhou 490b5c77fc Use switch expression where feasible 2023-12-04 15:42:55 +01:00
Sam Brannen 6ea9fdbf77 Polishing 2023-11-30 19:04:59 +01:00
Stéphane Nicoll 0785256b2f Match HandlerMapping lookup to bean signature
This commit makes sure to initialize any HandlerMapping defined in the
context when searching for resource handlers. Previously, the detection
algorithm was looking up for `SimpleUrlHandlerMapping` while the
declared target type in WebMvcConfigurationSupport is HandlerMapping.
If the application uses lazy initialization, the lookup algorithm would
not force that bean to be initialized.

Closes gh-25488
2023-11-26 09:59:12 +01:00
Sam Brannen dbad9fd208 Update copyright headers 2023-11-25 14:59:40 +01:00
Sam Brannen 657b1c6455 Document need for -parameters flag in exception messages
Closes gh-31675
2023-11-25 14:53:56 +01:00
Stéphane Nicoll c2745de60c Polish 2023-11-25 09:57:13 +01:00
Brian Clozel 15d9d9d06a Add current observation context in ClientRequest
Prior to this commit, `ExchangeFilterFunction` could only get the
current observation from the reactor context. This is particularly
useful when such filters want to add KeyValues to the observation
context.

This commit makes this use case easier by adding the context of the
current observation as a request attribute. This also aligns the
behavior with other instrumentations.

Fixes gh-31609
2023-11-24 17:36:15 +01:00
Sébastien Deleuze 441e210533 Treat kotlin.Unit as void in web controllers
This commit fixes a regression introduced by gh-21139
via the usage of Kotlin reflection to invoke HTTP
handler methods. It ensures that kotlin.Unit is treated
as void by returning null.

It also polishes CoroutinesUtils to have a consistent
handling compared to the regular case, and adds related
tests to prevent future regressions.

Closes gh-31648
2023-11-22 13:45:03 +01:00
Sébastien Deleuze c329ed83ef Polish InvocableHandlerMethodKotlinTests 2023-11-22 12:40:47 +01:00
Sam Brannen 7d2ea7e7e1 Ensure PathResourceResolvers log warnings for non-existent resources
Prior to this commit, the getResource() methods in PathResourceResolver
implementations allowed an exception thrown from Resource#getURL() to
propagate instead of logging a warning about the missing resource as
intended.

This commit modifies the getResource() methods in PathResourceResolver
implementations so that the log messages include the output of the
toString() implementations of the underlying resources instead of their
getURL() implementations, which may throw an exception.

Furthermore, logging the toString() output of resources aligns with the
existing output for "allowed locations" in the same log message.

Note that the toString() implementations could potentially also throw
exceptions, but that is considered less likely.

Closes gh-31623
2023-11-20 11:48:57 +01:00
Sam Brannen 7006d0a80e Polishing 2023-11-19 14:28:19 +01:00
Stéphane Nicoll f5453cc445 Polish 2023-11-10 16:42:43 +01:00
rstoyanchev 769128a0b2 Merge branch '6.0.x' 2023-11-09 12:53:36 +00:00
rstoyanchev 7714110940 Polishing in DefaultWebClient 2023-11-09 12:53:15 +00:00
rstoyanchev 75d1278bde Include port when logging URI in DefaultWebClient
Closes gh-30519
2023-11-09 12:53:15 +00:00
rstoyanchev 30e4a0a300 Polishing as a result of discussion under gh-31529 2023-11-02 16:18:25 +00:00
rstoyanchev f16122d533 Polishing and minor refactoring
Closes gh-31202
2023-11-02 11:32:03 +00:00
Carl-Eric Menzel d54a694f5a Add handler for unknown status codes
See gh-31202
2023-11-02 11:32:03 +00:00
Sam Brannen 3d248607dc Update copyright headers 2023-10-30 15:21:02 +01:00
Johnny Lim 2b750926c3 Polishing
Closes gh-31522
2023-10-30 15:05:20 +01:00
Brian Clozel c076f44144 Allow ETag generation configuration on ResourceHandlerRegistration
This commit surfaces the ETag generation feature for both
`ResourceHttpRequestHandler` and `ResourceWebHandler` on their
respective `ResourceHandlerRegistration` for easier configuration.

See gh-29031
2023-10-25 16:02:59 +02:00
Brian Clozel 9ac5eb0f55 Support ETag generation on ResourceWebHandler
This commit replicates the ETag generation option now available on
`ResourceHttpRequestHandler` but for its WebFlux counterpart.

See gh-29031
2023-10-25 16:01:15 +02:00
Brian Clozel ff14c5121d Refactor ResourceWebHandlerTests 2023-10-25 16:00:04 +02:00
Sébastien Deleuze a71eb3fb08 Merge branch '6.0.x' 2023-10-24 17:56:06 +02:00
Sébastien Deleuze 7874a59771 Remove invalid domain integration tests
Closes gh-31119
2023-10-24 17:54:39 +02:00
Stéphane Nicoll ef47eef92a Merge branch '6.0.x' 2023-10-24 10:57:09 +02:00
Stéphane Nicoll 9aa707ec4b Polish "Return consistent collection type for matrix variables"
See gh-31483
2023-10-24 10:55:42 +02:00
Sam Brannen 2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +02:00
Johnny Lim 64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Sam Brannen 37e6fe5b64 Update copyright headers 2023-10-22 11:28:40 +02:00
rstoyanchev a2f2f7c348 Use correct RequestParam resolver
Closes gh-31329
2023-10-20 12:39:50 +01:00
Sébastien Deleuze c6b86af78b Fall back on UTF-8 charset in WebClientResponseException
Instead of ISO-8859-1, consistently with the change done
in RestClientResponseException.

Closes gh-31072
2023-10-19 12:59:12 +02:00
rstoyanchev a53d3f3cea Apply DisconnectedClientHelper to @ExceptionHandler methods
Use the helper to reduce logging when an @ExceptionHandler fails
to write to the response due to a network failure where the client
has gone away.

Closes gh-26181
2023-10-17 15:52:24 +01:00
Johnny Lim 919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Sam Brannen 32b4f55d92 Update copyright headers 2023-10-16 16:19:55 +02:00
rstoyanchev b5b9386be6 Polishing
Closes gh-31413
2023-10-13 11:47:47 +01:00
Olga MaciaszekSharma 0cd196e3dd Add UriBuilderFactoryArgumentResolver
See gh-31413
2023-10-13 11:47:47 +01:00
Sébastien Deleuze e0ba42a80c Move ReactorResourceFactory to org.springframework.http.client package
Closes gh-31399
2023-10-10 15:58:20 +02:00
Arjen Poutsma 307a2c7d7b Polishing external contribution
See gh-29985
2023-10-10 14:16:00 +02:00
Jakob Fels ad50de169c Provide access to HTTP headers in resource routing
This commit adds additional overloaded methods that allow for HTTP
header manipulation of served resources.

Closes gh-29985
2023-10-10 14:16:00 +02:00
Arjen Poutsma 59d123a18e Introduce OutputStream BodyInserter
This commit introduces a BodyInserter that inssert any bytes written to
an output stream to the body of an output message.

Closes gh-31184
2023-10-05 15:31:08 +02:00
rstoyanchev 4a10fa67a5 Expose HttpRequest from ClientResponse
Closes gh-28397
2023-10-04 13:05:09 +01:00
Kai Zander e8b42c5439 Optimize uses of onErrorResume()
This commit replaces uses of onErrorResume() with
- onErrorMap() in places where onErrorResume() is just used to map to a
  different exception.
- onErrorComplete() where onErrorResume() just maps to Mono.empty().
- onErrorReturn() where onErrorResum() just maps to Mono.just().

Closes gh-31352
2023-10-03 14:42:24 +02:00
Sam Brannen 45d8aadb0a Polishing 2023-09-27 10:19:51 +02:00
Stéphane Nicoll 7a05d23597 Polish contribution
See gh-31320
2023-09-27 08:58:11 +02:00
김희망 6caef9bb3c Refine ServerRequest.queryParamOrNull implementation
Closes gh-31264
2023-09-20 15:51:09 +02:00
Sébastien Deleuze 20df52e543 Merge branch '6.0.x' 2023-09-15 18:16:26 +02:00
Sébastien Deleuze ce0923b946 Remove Reactor Netty 2 from integration tests
Closes gh-31243
2023-09-15 18:15:26 +02:00
Arjen Poutsma 056de7e898 Enable disabled multi-part Netty 2 tests
See gh-31110
2023-09-15 14:20:12 +02:00
Sébastien Deleuze 68ba55bea9 Fix ModelInitializerKotlinTests
See gh-30894
2023-09-13 18:30:01 +02:00
Sébastien Deleuze bb85d9b5e4 Merge branch '6.0.x' 2023-09-13 18:07:59 +02:00
Sébastien Deleuze 29a4dabbe7 Support @ModelAttribute with suspending function in WebFlux
Closes gh-30894
2023-09-13 17:59:39 +02:00
Sam Brannen 5dacf688b2 Polishing 2023-09-13 16:01:11 +02:00
Stephane Nicoll 01f717375b Introduce ObjectUtils#nullSafeHash(Object... element)
This commit deprecates the various nullSafeHashCode methods taking array
types as they are superseded by Arrays.hashCode now. This means that
the now only remaining nullSafeHashCode method does not trigger a
warning only if the target type is not an array. At the same time, there
are multiple use of this method on several elements, handling the
accumulation of hash codes.

For that reason, this commit also introduces a nullSafeHash that takes
an array of elements. The only difference between Objects.hash is that
this method handles arrays.

The codebase has been reviewed to use any of those two methods when it
is possible.

Closes gh-29051
2023-09-13 15:14:34 +02:00
rstoyanchev bd4b3866fc Revise solution for WebFlux JettyRequestUpgradeStrategy
See gh-30344
2023-09-13 13:25:13 +01:00
Sam Brannen c23795a8a6 Update copyright headers 2023-09-13 13:57:51 +02:00
rstoyanchev 1f1f222b8b Partial revert of 1f8913a9
For WebFlux we can't use ServletContextAware.

See gh-30344
2023-09-13 12:05:09 +01:00
rstoyanchev 74182cd3d6 Ensure correct detection of Jetty WebSocket server 2023-09-13 09:34:07 +01:00
rstoyanchev 1f8913a96c Support Jetty WebSocket server parameters
Closes gh-30344
2023-09-13 09:34:07 +01:00
Sébastien Deleuze abb296c7d2 Remove Java code dependency on CoWebFilter
To avoid compilation errors in Eclipse which does
not support Java code dependency on Kotlin code.

See gh-27522
2023-09-12 19:27:49 +02:00
Arjen Poutsma c5c843696b Polishing external contribution 2023-09-12 12:34:44 +02:00
James Yuzawa 39786e4790 Improve attribute handling in RequestPredicates
This commit changes the way request attributes are handled in
RequestPredicates. Previously, the AND/OR/NOT predicates copied all
attributes in a map, and restored that when the delegate predicate(s)
failed.
Now, we only set the attributes when all delegates have succeeded.

Closes gh-30028
2023-09-12 12:34:44 +02:00
Rossen Stoyanchev ed172d6269 ByteBuffer handling for Jetty WebSocket messages
Closes gh-31182
2023-09-12 10:08:57 +01:00
Sébastien Deleuze dfd631e662 Merge branch '6.0.x' 2023-09-11 18:10:13 +02:00
Sébastien Deleuze 76b8bb2c75 Refine CORS documentation for wildcard processing
This commit refines CORS wildcard processing Javadoc to
provides more details on how wildcards are handled for
Access-Control-Allow-Methods, Access-Control-Allow-Headers
and Access-Control-Expose-Headers CORS headers.

For Access-Control-Expose-Headers, it is not possible to copy
the response headers which are not available at the point
when the CorsProcessor is invoked. Since all the major browsers
seem to support wildcard including on requests with credentials,
and since this is ultimately the user-agent responsibility to
check on client-side what is authorized or not, Spring Framework
continues to support this use case.

See gh-31143
2023-09-11 18:07:31 +02:00
Sam Brannen 40f1cf67bd Polish DefaultClientResponseTests and suppress "unchecked" warnings 2023-09-08 15:21:48 +02:00
Sébastien Deleuze 5fd356e44f Remove outdated `@Suppress("DEPRECATION")` annotations
See gh-31127
2023-09-08 13:18:16 +02:00
Sébastien Deleuze 6f38e90048 Merge branch '6.0.x' 2023-09-08 13:08:14 +02:00
Sébastien Deleuze 12a01a680b Document some non-nullable Kotlin extensions can throw NoSuchElementException
Closes gh-31189
2023-09-08 13:07:58 +02:00
Sam Brannen c3a0022c9e Polish DefaultClientResponseTests and suppress "unchecked" warnings 2023-09-07 17:09:31 +02:00
rstoyanchev fefbeeeb18 Merge branch '6.0.x' 2023-09-07 15:27:56 +01:00
rstoyanchev a6b567a630 Polishing 2023-09-07 15:27:40 +01:00
rstoyanchev 7a516170ef WebClientResponseException supports decoding empty content
Closes gh-31179
2023-09-07 15:27:40 +01:00
Sébastien Deleuze b0aa004d9d Propagate CoroutineContext in CoWebFilter
This provides an elegant and dynamic way to customize the
CoroutineContext in WebFlux with the annotation programming
model.

Closes gh-27522
2023-09-07 12:08:12 +02:00
Sam Brannen fad70aa252 Update copyright headers 2023-09-04 14:30:44 +02:00
rstoyanchev b068742ec8 Support method validation for Lists in WebMvc and WebFlux
Closes gh-31120
2023-09-04 13:22:09 +01:00
Arjen Poutsma 6597727c86 Upgrade to Jetty 12
This commit upgrades Spring Framework to Jetty 12.0.1, and Reactive HTTP
 Client 4.0.0.

Closes gh-30698
2023-09-04 14:03:29 +02:00
Sébastien Deleuze 81607238ce Use consistently `@since 6.1` 2023-09-01 12:33:21 +02:00
rstoyanchev 32f128b6ba Add create static factory method to WebClientAdapter
Closes gh-31120
2023-08-30 16:37:28 +01:00
Sébastien Deleuze 38392233ba Add context function to CoRouterFunctionDsl
This new function allows to customize the CoroutineContext
potentially dynamically based on the incoming
ServerRequest.

Closes gh-27010
2023-08-29 12:59:35 +02:00
Sébastien Deleuze d47c7f9552 Propagate CoroutineContext in coRouter filters
Closes gh-26977
2023-08-29 10:40:32 +02:00
Sébastien Deleuze bcf11e8919 Replace Reactive awaitSingle() usages by the Mono variant
Closes gh-31127
2023-08-29 09:49:44 +02:00
Arjen Poutsma 76c032cc11 Schedule blocking ResourceHttpMessageWriter operations on bounded elastic
This commit schedules blocking I/O operations on the bounded elastic
scheduler, which includes retrieving the content length and writing
the resource (region).

Closes gh-30928
2023-08-28 12:54:52 +02:00
Sam Brannen e737e6d9ba Update copyright headers 2023-08-25 17:07:17 +02:00
Sébastien Deleuze 21613eabf1 Properly use Reactor Netty 2 in AbstractHttpHandlerIntegrationTests
Closes gh-31095
2023-08-24 10:46:43 +02:00
Sébastien Deleuze 334b1548b7 Merge branch '6.0.x'
Adapt gh-31045 fix to the main branch, and throw a
WebExchangeBindException instead of a ServerWebInputException.
2023-08-18 15:11:16 +02:00
Sébastien Deleuze e6565c600a Refine type conversion errors in ModelAttributeMethodProcessor
This commit turns TypeMismatchException thrown in
ModelAttributeMethodArgumentResolver#createAttribute into
proper ServerWebInputException in order get HTTP response
with 400 Bad Request status code instead of 500 Internal error.

Closes gh-31045
2023-08-18 14:31:43 +02:00
Sébastien Deleuze 8af9648c43 Polish ModelAttributeMethodArgumentResolverTests 2023-08-18 12:47:44 +02:00
Arjen Poutsma 34477b4f03 Schedule FreeMarker template lookup on bounded elastic scheduler
This commit makes sure that FreeMarker template lookups, which
potentially block, are scheduled on the bounded elastic scheduler.

Closes gh-30903
2023-08-17 16:42:44 +02:00
Sébastien Deleuze 02d003127f Move ServerWebExchange Kotlin extensions
This commit moves ServerWebExchange Kotlin extensions
where they belong: in the spring-web module with the
org.springframework.web.server package, like
ServerWebExchange itself.

The extensions in the wrong location are deprecated
and semi-automated migration to the new variants is
made possible via @Deprecated + ReplaceWith(...).

Some tests have been added as well.

Closes gh-31046
2023-08-15 18:03:41 +02:00
Sam Brannen 59b78cc513 Polishing 2023-08-05 10:49:39 +03:00
rstoyanchev 6630b16771 Polishing
See gh-30980
2023-08-04 18:21:42 +03:00
Olga MaciaszekSharma d1d5b54f12 Support @HttpExchange for server-side handling
See gh-30980
2023-08-04 18:21:42 +03:00
Juergen Hoeller d250a5155a Consistent dependency declarations 2023-08-02 00:56:50 +02:00
Juergen Hoeller ae279eaced Polishing 2023-08-01 23:52:48 +02:00
Juergen Hoeller 3b1af692cc Merge branch '6.0.x'
# Conflicts:
#	spring-beans/spring-beans.gradle
#	spring-context/spring-context.gradle
#	spring-orm/spring-orm.gradle
#	spring-test/spring-test.gradle
#	spring-web/spring-web.gradle
#	spring-webflux/spring-webflux.gradle
2023-08-02 01:04:31 +02:00
Juergen Hoeller b9ae996dfc Merge branch '6.0.x'
# Conflicts:
#	spring-context/spring-context.gradle
#	spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java
#	spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java
#	spring-test/spring-test.gradle
#	spring-webmvc/spring-webmvc.gradle
2023-08-02 00:16:55 +02:00
Sam Brannen f00756bc7c Update copyright headers 2023-08-01 14:55:04 +03:00
rstoyanchev 78d0dbb519 Ensure handling of 404 errors for static resources
Closes gh-30930
2023-07-27 22:13:10 +03:00
Rossen Stoyanchev 85704c890e Use DispatchExceptionHandler for handler errors
See gh-30930
2023-07-27 22:13:10 +03:00
Juergen Hoeller 3437e61f98 Merge branch '6.0.x' 2023-07-26 12:08:20 +02:00
Juergen Hoeller 2573ba4a50 Polishing 2023-07-26 12:07:11 +02:00
Juergen Hoeller bbde68c49e Polishing 2023-07-25 19:12:07 +02:00
rstoyanchev 37eaded63d Support BindParam annotation
Allows customizing the name of the request parameter to bind a
constructor parameter to.

Closes gh-30947
2023-07-25 16:15:55 +03:00
Juergen Hoeller 5ebbb3ff3e Merge branch '6.0.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java
2023-07-25 19:13:33 +02:00
Juergen Hoeller 25ea1f4c0f Merge branch '6.0.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java
2023-07-19 00:37:06 +02:00
Juergen Hoeller 2f33e77ab4 Consistent equals/hashCode style (and related polishing) 2023-07-19 00:35:19 +02:00
Sam Brannen a34f9fa66c Update copyright headers 2023-07-15 13:10:46 +02:00
Sam Brannen 01ceee8de5 Polishing 2023-07-15 13:36:11 +02:00
Johnny Lim be8bfad3af Enable KotlinScriptTemplateTests in Spring WebFlux on Java 20
See gh-29249
Closes gh-30896
2023-07-15 13:35:59 +02:00
Sam Brannen 70cf754a2f Suppress warnings in tests 2023-07-15 13:02:16 +02:00
Sam Brannen e6d360c1c6 Polishing 2023-07-15 12:58:18 +02:00
rstoyanchev 3c9cfa8a0f Revise order of method declarations in WebFluxConfigurer
See gh-30678
2023-07-12 17:09:57 +01:00
rstoyanchev b016f385e1 Add BlockingExecutionConfigurer to WebFlux config
Closes gh-30678
2023-07-12 16:55:02 +01:00
rstoyanchev 74972fb751 Add updateModel to BindingContext
The method includes logic that is currently in
ViewResolutionResultHandler but fits well in BindingContext and also
includes the call to saveModel method from the InitBinderBindingContext
subclass, which was called too early until now from
RequestMappingHandlerAdapter before the model has been fully updated.

This mirrors a similar method in ModelFactory on the Spring MVC side
which also combines those two tasks.

Closes gh-30821
2023-07-11 16:34:03 +01:00
rstoyanchev 39e74d89e1 Merge branch '6.0.x' 2023-07-11 11:17:41 +01:00
rstoyanchev 20afa3265a Encapsulate full path initialization 2023-07-11 11:10:20 +01:00
Arjen Poutsma d04d7b2e57 Add request binding to functional endpoints
This commit introduces form binding to ServerRequest in both WebMVC.fn
and WebFlux.fn's, in the form of a bind(Class) method.

Closes gh-25943
2023-07-11 09:52:39 +02:00
rstoyanchev a3e37597aa Add ReactiveHttpRequestValues
Separate collection and handling of reactive request values into a
subclass of HttpRequestValues.

Closes gh-30117
2023-07-11 07:42:04 +01:00
Rossen Stoyanchev 22376c2efa Polishing
See gh-30117
2023-07-10 11:24:30 +01:00
Rossen Stoyanchev 068dc7db28 Remove use of TestHttpClientAdapter
Now that HttpClientAdapter is deprecated and replaced by HttpExchangeAdapter
and ReactorHttpExchangeAdapter, our tests should use the new contracts.

See gh-30117
2023-07-10 10:36:16 +01:00
Sébastien Deleuze b3de1b8e95 Use consistently *KotlinTests naming for Kotlin tests
Closes gh-30837
2023-07-08 11:02:20 +02:00
Sébastien Deleuze fb17e283d1 Replace @link by proper KDoc class reference in tests
Closes gh-30836
2023-07-08 10:44:40 +02:00
Olga MaciaszekSharma 268f3c853e Add RestTemplate support for HTTP interface client
See gh-30117
2023-07-06 19:07:40 +02:00
Juergen Hoeller f07b9fd217 Polishing 2023-07-04 16:52:44 +02:00
Sébastien Deleuze d3a249e34d Reduce the delay used for Coroutines in tests
Closes gh-30731
2023-06-23 14:17:56 +02:00
Rossen Stoyanchev bf82ed7186 Add HttpExchangeAdapter
See gh-30117
2023-06-23 11:49:29 +01:00
Sébastien Deleuze 8fb412ea74 Merge branch '6.0.x' 2023-07-08 11:11:37 +02:00
rstoyanchev deaa493644 Add Visitor to HandlerMethodValidationException
Closes gh-30813
2023-07-04 17:19:58 +01:00
Juergen Hoeller 834d22f866 Polishing 2023-07-04 16:08:24 +02:00
rstoyanchev 1fc020cf92 Fix checkstyle violations 2023-07-03 15:31:35 +01:00
rstoyanchev 592ab0f350 Add ~.validation.method package
Extract classes from ~.validation.beanvalidation without a direct
dependency on beanvalidation.

See gh-30644
2023-07-03 15:05:51 +01:00
rstoyanchev 7a79da589a Add default web handling of method validation errors
Closes gh-30644
2023-07-03 12:08:11 +01:00
rstoyanchev a481c7649f Refactor to prepare for method validation handling
To handle method validation errors in ResponseEntityExceptionHandler,
MethodValidationException and associated types should not depend on
Bean Validation. To that effect:

1. MethodValidationResult and ParameterValidationResult no longer make
the underlying ConstraintViolation set available, and instead expose
only the adapted validation errors (MessageSourceResolvable, Errors),
analogous to what SpringValidatorAdapter does. And likewise
MethodValidationException no longer extends ConstraintViolationException.

2. MethodValidationPostProcessor has a new property
adaptConstraintViolations to decide whether to simply raise
ConstraintViolationException, or otherwise to adapt the ConstraintViolations
and raise MethodValidationException instead, with the former is the default
for compatibility.

3. As a result, the MethodValidator contract can now expose methods that
return MethodValidationResult, which provided more flexibility for handling,
and it allows MethodValidationAdapter to implement MethodValidator directly.

4. Update Javadoc in method validation classes to reflect this shift, and
use terminology consistent with Spring validation in classes without an
explicit dependency on Bean Validation.

See gh-30644
2023-07-03 12:08:11 +01:00
rstoyanchev 91eb2be44c Remove no longer supported protected methods
Closes gh-26721
2023-06-27 16:34:52 +01:00
rstoyanchev 11a416156b Use ResolvableType to create WebDataBinder
This provides more flexibility to pass a targetType even if
a MethodParameter is not available.

See gh-26721
2023-06-26 13:11:05 +01:00