Description
Keith Donald opened SPR-6740 and commented
Differences I've noticed so far:
-
When using
@RequestBody
to bind the request body to a JavaBean, you cannot also declare a BindingResult parameter to trap bind failures. Any failures result seems to result in an exception (500) being thrown. For example, when Jackson fails to bind a 500 error is returned and you have no control over this like you do when failures are first added to the BindingResult context. -
When using
@RequestBody
you cannot trigger execution of a validation step post binding with the@Valid
annotation.
We should look at getting consistency between the "traditional" DataBinder mechanism and the @RequestBody
mechanism where it is possible. If it's not possible or practical, we should at least document the differences between traditional binding and @RequestBody
/@ResponseBody
usage.
Affects: 3.0 GA
Issue Links:
- Allow usage of ConversionService for Jackson HttpMessageConverter [SPR-7054] #11715 Allow usage of ConversionService for Jackson HttpMessageConverter
4 votes, 7 watchers