类 MethodArgumentNotValidException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- org.springframework.web.bind.MethodArgumentNotValidException
- 所有已实现的接口:
Serializable
public class MethodArgumentNotValidException extends Exception
Exception to be thrown when validation on an argument annotated with@Valid
fails.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 MethodArgumentNotValidException(MethodParameter parameter, BindingResult bindingResult)
Constructor forMethodArgumentNotValidException
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BindingResult
getBindingResult()
Return the results of the failed validation.String
getMessage()
MethodParameter
getParameter()
Return the method parameter that failed validation.
构造器详细资料
MethodArgumentNotValidException
public MethodArgumentNotValidException(MethodParameter parameter, BindingResult bindingResult)
Constructor forMethodArgumentNotValidException
.- 参数:
parameter
- the parameter that failed validationbindingResult
- the results of the validation
方法详细资料
getParameter
public MethodParameter getParameter()
Return the method parameter that failed validation.
getBindingResult
public BindingResult getBindingResult()
Return the results of the failed validation.
getMessage
public String getMessage()
- 覆盖:
getMessage
在类中Throwable