Commit Graph

3996 Commits

Author SHA1 Message Date
rstoyanchev f814fb420b Merge branch '5.3.x' 2022-07-13 19:21:33 +01:00
rstoyanchev e50131d454 Add Consumer methods to configure Jackson modules
Closes gh-28633
2022-07-13 19:10:51 +01:00
rstoyanchev cdd4e8cd7f Improve regex support for URL path matching
Closes gh-28815
2022-07-13 18:43:51 +01:00
Sam Brannen a81558ee5a Polishing 2022-07-13 16:58:59 +02:00
Sam Brannen 3ff1326cbb Merge branch '5.3.x' 2022-07-13 13:23:21 +02:00
Sam Brannen 222dbf8377 Update copyright date 2022-07-13 13:22:40 +02:00
kacperkrzyzak 10838a636f Correctly identify MaxUploadSizeExceededException in StandardMultipartHttpServletRequest
This commit correctly identifies MaxUploadSizeExceededException in
StandardMultipartHttpServletRequest by converting keywords in the
exception message to lowercase before checking for their presence, for
compatibility with Jetty 9.4.x.

Closes gh-28759
2022-07-13 13:17:53 +02:00
Stephane Nicoll 2c92d7da8f Harmonize RuntimeHintsRegistrar implementations
Closes gh-28801
2022-07-12 18:30:23 +02:00
rstoyanchev 380aedb12a Add ProblemDetailJacksonMixin
Closes gh-28665
2022-07-12 13:04:58 +01:00
Sam Brannen 3f993f8639 Merge branch '5.3.x'
# Conflicts:
#	spring-web/src/main/java/org/springframework/web/accept/AbstractMappingContentNegotiationStrategy.java
2022-07-12 12:14:52 +02:00
Marc Wrobel 6f494ef438 Fix and improve Javadoc in spring-web
Closes gh-28791
2022-07-12 12:08:12 +02:00
Sébastien Deleuze 9d42779826 Add reflection hints for data binding in Web controllers
Closes gh-28623
2022-07-11 11:41:33 +02:00
Arjen Poutsma a64d3716e0 Merge branch '5.3.x' 2022-07-08 16:43:28 +02:00
Arjen Poutsma aa8b06b622 Delete file on multipart cancel
This commit makes sure that the temporary file used for multipart
storage is deleted when the source stream is malformed or cancelled.

Closes gh-28740
2022-07-08 16:36:01 +02:00
rstoyanchev 0938909cd9 Switch to Reactor 2022.0.0 snapshots
See gh-28766
2022-07-06 11:58:28 +01:00
Sam Brannen adb2eef749 Clean up warnings and remove unused code 2022-07-03 18:56:47 +02:00
Johnny Lim 1205f53c4a Polish 2022-07-02 15:11:35 +09:00
rstoyanchev a575590c01 Merge branch '5.3.x' 2022-07-01 09:42:18 +01:00
rstoyanchev 058ce36402 Improve ExtendedWebExchangeDataBinder implementation
Close gh-28646
2022-07-01 03:23:32 +01:00
Sam Brannen 033d9d09e4 Merge branch '5.3.x' 2022-06-30 16:56:43 +02:00
Sam Brannen 9ea45697ac Support cookie comments in MockHttpServletResponse and MockCookie
Prior to this commit, if a cookie was added to MockHttpServletResponse,
the comment attribute was not included in the generated Set-Cookie
header. In addition, MockCookie.parse(String) did not support the
Comment attribute.

This commit addresses both of these issues.

Closes gh-28730
2022-06-30 16:51:43 +02:00
Sébastien Deleuze e94f2a8e3f Add Jackson well-known module runtime hints
Closes gh-28709
2022-06-30 15:26:44 +02:00
Sébastien Deleuze 9135921d1d Move BindingReflectionHintsRegistrar to spring-context
Closes gh-28735
2022-06-30 11:56:08 +02:00
Sébastien Deleuze 4ec3e1042a Add runtime hints for WebFlux
Closes gh-28701
2022-06-30 10:02:34 +02:00
rstoyanchev b312eca391 Deprecate and set trailingSlash option to false
Closes gh-28552
2022-06-29 16:09:10 +01:00
rstoyanchev 92cf1e13e8 Enable use of parsed patterns by default in Spring MVC
Closes gh-28607
2022-06-29 10:17:27 +01:00
rstoyanchev 8a9b082d8a Improve MappingMatch determination in mock request
MockHttpServletRequest now checks the requestURI and servletPath to
check whether they imply a Servlet path mapping, which is the case
when the requestURI is longer than the contextPath + servletPath.

This is essential when parsed patterns are in use in which case the
request path is parsed taking into account only the requestURI and
the contextPath. However, if the MappingMatch indicates a match by
Servlet path, then the servletPath is also taken into account.

See gh-28607
2022-06-29 10:17:07 +01:00
Sébastien Deleuze 798dd4fec0 Add missing build time class initialization
As gh-28624 supports only static boolean fields, we still
need a few classes to be initialized at build time.

Such explicit configuration should be in theory avoidable,
so we will work with the GraalVM team to see if this can be
fixed, see for example
https://github.com/oracle/graal/issues/4673
for HttpStatus.

See gh-28624
2022-06-27 19:08:20 +02:00
Sébastien Deleuze 22a750f378 Replace build-time initialization by constant fields
This commit leverages a subset of @philwebb initial experimentation
to compute at build time the value of specific boolean static fields
in native images. This enhancement is implemented for now as a
GraalVM feature.

The goal here is to keep an optimized footprint via build time code
removal without leveraging build-time class initialization which is known
for the blocking compatibility issues it introduces due to its viral nature.

For now, the static fields initialized at build time with native are:
 - NativeDetector#imageCode
 - Fields with a name ending by "Present" in "org.springframework" package
   typically used for classpath check with ClassUtils#isPresent

Closes gh-28624
2022-06-24 13:54:20 +02:00
rstoyanchev 98c7d8100d Remove "with" methods in ProblemDetail
ProblemDetail is intended to be extended with additional fields. This
commit removes its "with" methods for chained initialization to keep
it as plain as possible and avoid imposing a particular style on
subclasses.

See gh-27052
2022-06-24 11:08:32 +01:00
rstoyanchev c139f3d526 Add generic properties map to ProblemDetail
Closes gh-28665
2022-06-24 10:42:20 +01:00
rstoyanchev b72ee5f034 Add static factory methods to WebClientAdapter
Ideally one would pass WebClient directly to HttpServiceProxyFactory,
but two need to remain decoupled. This commit adds static, shortcut
methods to WebClientAdapter to create an HttpServiceProxyFactory, thus
eliminating the step to wrap the WebClient.
2022-06-24 09:55:21 +01:00
rstoyanchev 45ee7913bf Polishing ProblemDetail support
See gh-28665
2022-06-24 09:55:21 +01:00
Brian Clozel 0783f0762d Improve conditional requests support
Prior to this commit, Spring MVC and Spring WebFlux would not support
conditional requests with `If-Match` preconditions. As underlined in the
RFC9110 Section 13.1, those are related to the `If-None-Match`
conditions, but this time only performing requests if the resource
matches the given ETag.

This feature, and in general the `"*"` request Etag, are generally
useful to prevent "lost updates" when performing a POST/PUT request: we
want to ensure that we're updating a version with a known version or
create a new resource only if it doesn't exist already.

This commit adds `If-Match` conditional requests support and ensures
that both `If-Match` and `If-None-Match` work well with `"*"` request
ETags.

We can't rely on `checkNotModified(null)`, as the compiler can't decide
between method variants accepting an ETag `String` or a Last Modified
`long`. Instead, developers should use empty ETags `""` to signal that
no resource is known on the server side.

Closes gh-24881
2022-06-21 19:29:20 +02:00
Sébastien Deleuze 93b340e563 Add reflection hints for HttpEntity
For those used in Web controllers.

Closes gh-28622
2022-06-20 18:15:43 +02:00
Sam Brannen 04dde03451 Merge branch '5.3.x' 2022-06-20 16:03:09 +02:00
Sam Brannen e19e9757d4 Polishing 2022-06-20 15:19:02 +02:00
Lars Grefer 181023c0c3 Update to Bouncycastle 1.71
Closes gh-28636
2022-06-16 16:03:11 +02:00
Lars Grefer f41b99218e Update to Bouncycastle 1.71 2022-06-16 03:21:41 +02:00
Juergen Hoeller aa48dec697 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
2022-06-14 15:14:10 +02:00
Juergen Hoeller d7be1e0dab Polishing 2022-06-14 15:09:39 +02:00
Juergen Hoeller 30c873b4b5 Move NestedServletExceptionTests to spring-web module
See gh-25162
2022-06-14 15:09:21 +02:00
Stephane Nicoll 77ad4a1428 Polish 2022-06-14 14:15:29 +02:00
Juergen Hoeller 639c047f2f Apply StringUtils.cleanPath for Windows path compatibility
See gh-28006
2022-06-14 14:02:17 +02:00
Juergen Hoeller 4e1b9f1492 Replace deep exception message nesting with custom inclusion of cause messages
Includes deprecation of NestedServletException, whereas NestedCheckedException and NestedRuntimeException remain as base classes with several convenience methods.

Closes gh-25162
2022-06-14 14:00:28 +02:00
Arjen Poutsma 1881e48bb4 Remove Jetty dependencies from JdkHttpClientResourceFactory
This commit removes the Eclipse Jetty dependencies from
JdkHttpClientResourceFactory, replacing them with a check for
ExecutorService.

Closes gh-28588
2022-06-14 10:59:02 +02:00
Sébastien Deleuze a57dead4be Add support for serialization in RequestMappingReflectiveProcessor
Support reflection-based serialization of parameters annotated
with @RequestBody and return values annotated with @ResponseBody.

It leverages a new BindingReflectionHintsRegistrar class that
is designed to register transitively the types usually needed
for binding and reflection-based serialization on fields,
constructors and properties. Generics are taken in account
as well.

Closes gh-28518
2022-06-13 15:25:44 +02:00
Sébastien Deleuze 2b76a12b86 Refine build time init configuration
For Spring MVC and RestTemplate.

See gh-28518
2022-06-13 14:54:57 +02:00
Stephane Nicoll 0992f855e6 Add base infra for Web controllers hints
See gh-28518
2022-06-13 14:52:45 +02:00
Arjen Poutsma 472af9c25f Merge branch '5.3.x' 2022-06-13 14:02:02 +02:00