Commit Graph

2559 Commits

Author SHA1 Message Date
rstoyanchev 78d0dbb519 Ensure handling of 404 errors for static resources
Closes gh-30930
2023-07-27 22:13:10 +03:00
rstoyanchev 67e3d86bd8 Support declarativeBinding mode in DataBinder
Closes gh-30948
2023-07-25 18:04:21 +03: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 bbde68c49e Polishing 2023-07-25 19:12:07 +02:00
Sam Brannen 05956d4028 Change MvcSimpleAsyncTaskExecutor.taskExecutorWarning to primitive boolean 2023-07-19 13:21:57 +03: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
rstoyanchev 73c06347be Update WebMvc docs on use of AsyncTaskExecutor
Closes gh-30905
2023-07-18 10:42:27 +01:00
rstoyanchev 4becce1c2b Consolidate default WebMvc executor log warnings
Closes gh-30902
2023-07-18 10:22:45 +01:00
Sam Brannen 30d6ec3398 Update copyright headers 2023-07-15 16:01:15 +02:00
Johnny Lim ab83972c3e Add missing @Nullable annotations in AbstractResourceResolver subclasses
See gh-30601
Closes gh-30893
2023-07-15 16:00:32 +02:00
rstoyanchev 8a283e39ff Update DefaultHandlerExceptionResolver logging
Reduce logging for NoResourceFoundException and NoHandlerFoundException.

Closes gh-30884
2023-07-14 15:11:19 +01:00
Sam Brannen bcd09d7ad8 Merge branch '6.0.x' 2023-07-15 16:01:47 +02:00
Sam Brannen 0611192dac Enable KotlinScriptTemplateTests in Spring MVC on Java 20
See gh-29249
Closes gh-30896
2023-07-15 13:36:11 +02:00
Sam Brannen 63fe45d92a Update copyright headers 2023-07-15 13:11:29 +02:00
Sam Brannen 70cf754a2f Suppress warnings in tests 2023-07-15 13:02:16 +02:00
Sam Brannen 16b9640af2 Merge branch '6.0.x' 2023-07-12 11:50:11 +02:00
Sam Brannen 68f2b0ca59 Rely on auto-boxing in tests 2023-07-12 11:49:02 +02: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
Patrick Strawderman 372282457f Use Collections.emptyEnumeration() where appropriate
Closes gh-30803
2023-07-05 13:47:11 +02:00
Juergen Hoeller b77d4d01c5 Adapt no-arg value from interface-based InvocationHandler callback
Closes gh-30756
2023-06-26 19:28:19 +02:00
Sam Brannen f86a69ebfb Update copyright headers and polish 2023-06-24 14:14:02 +02:00
Sam Brannen 39bc7566df Stop printing to System.out in tests 2023-06-24 14:10:12 +02:00
Sam Brannen 299b86bae3 Merge branch '6.0.x' 2023-07-05 14:02:49 +02:00
Arjen Poutsma 496155525c Allow built ServerResponse to throw exception
This commit ensures that ServerResponse.HeadersBuilder::build can throw
an exception, by introducing a separate functional interface that does
allow for exceptions to be thrown.

Closes gh-30818
2023-07-05 12:01:55 +02:00
Juergen Hoeller 6fa09e1783 Extract AnnotatedMethod base class for consistent annotation exposure
As a consequence, the spring-messaging HandlerMethod detects interface parameter annotations as well, and the same is available for other HandlerMethod variants.

Closes gh-30801
2023-07-04 20:42:30 +02:00
rstoyanchev deaa493644 Add Visitor to HandlerMethodValidationException
Closes gh-30813
2023-07-04 17:19:58 +01: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 d4ac90dae0 Support nested constructors in DataBinder
Closes gh-20806
2023-06-26 17:01:44 +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
rstoyanchev ea398d7b7e Support constructing target object in DataBinder
See gh-26721
2023-06-22 20:36:28 +01:00
Juergen Hoeller 3f40452511 Merge branch '6.0.x' 2023-06-26 19:36:20 +02:00
Sam Brannen 854715d9a7 Update copyright headers 2023-06-25 15:39:16 +02:00
Sam Brannen 19686adc01 Merge branch '6.0.x' 2023-06-24 14:15:05 +02:00
Sébastien Deleuze f06cf21341 Support Kotlin parameter default values in handler methods
This commit adds support for Kotlin parameter default values
in handler methods. It allows to write:
@RequestParam value: String = "default"
as an alternative to:
@RequestParam(defaultValue = "default") value: String

Both Spring MVC and WebFlux are supported, including on
suspending functions.

Closes gh-21139
2023-06-22 16:08:48 +02:00
Sam Brannen 06b6c4bcf9 Update copyright headers 2023-06-22 14:56:09 +02:00
Sam Brannen 0605172d4d Merge branch '6.0.x'
# Conflicts:
#	spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java
2023-06-20 13:29:06 +02:00
Sam Brannen 67798a7b52 Fix CSS classes in Javadoc HTML tables due to upgrade to Java 17
Closes gh-30701
2023-06-20 13:24:03 +02:00
rstoyanchev 089d938e15 Set throwExceptionIfNoHandlerFound=true and deprecate
Closes gh-29491
2023-06-19 17:18:09 +01:00
rstoyanchev c00508d6cf Raise and handle NoResourceFoundException
See gh-29491
2023-06-19 17:18:08 +01:00
Stephane Nicoll 83b0f4f394 Merge branch '6.0.x' 2023-06-19 15:47:26 +02:00
Stephane Nicoll 294cdba80c Update copyright year of changed file
See gh-30601
2023-06-19 15:44:04 +02:00
cwatzl 072a86149d Flag PathResourceResolver#resolve*Internal as @Nullable
See gh-30601
2023-06-19 15:37:16 +02:00
Sam Brannen a2072de391 Update copyright headers 2023-06-15 16:21:13 +02:00