请问 @Past 注解都有哪些属性,哪个属性可以捕捉日期输入的格式错误.我在页面输入错误的日期格式,页面会有报错的代码
@DateTimeFormat(pattern="yyyy-MM-dd")
@Past(message="生日必须是一个过去的日期")//这里是否还要添加其他属性值
private Date birthday;//这是我的javabean使用了@Past注解
当我在注册页面中"日期"输入错误格式,页面出现如下错误代码:
Failed to convert property value of type java.lang.String to required type java.util.Date for property birthday; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type @org.springframework.format.annotation.DateTimeFormat @javax.validation.constraints.Past java.util.Date for value 123; nested exception is java.lang.IllegalArgumentException: Unable to parse 123