Use MethodArgumentNotValidException for model attributes
Closes gh-29251
This commit is contained in:
@@ -472,8 +472,11 @@ public abstract class ResponseEntityExceptionHandler implements MessageSourceAwa
|
||||
* @param request the current request
|
||||
* @return a {@code ResponseEntity} for the response to use, possibly
|
||||
* {@code null} when the response is already committed
|
||||
* @deprecated as of 6.0 since {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor}
|
||||
* now raises the {@link MethodArgumentNotValidException} subclass instead.
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
protected ResponseEntity<Object> handleBindException(
|
||||
BindException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) {
|
||||
|
||||
|
||||
@@ -574,7 +574,10 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes
|
||||
* @param handler the executed handler
|
||||
* @return an empty {@code ModelAndView} indicating the exception was handled
|
||||
* @throws IOException potentially thrown from {@link HttpServletResponse#sendError}
|
||||
* @deprecated as of 6.0 since {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor}
|
||||
* now raises the {@link MethodArgumentNotValidException} subclass instead.
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
protected ModelAndView handleBindException(BindException ex, HttpServletRequest request,
|
||||
HttpServletResponse response, @Nullable Object handler) throws IOException {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user