【发布时间】:2012-01-28 23:56:50
【问题描述】:
默认情况下org.hibernate.validator.constraints.Email 显示not a well-formed email address,但如果用户只输入foo 需要格式良好的电子邮件,我想显示foo is not a well-formed email address。所以我需要有一个foo 的占位符。我的域对象中的属性用@Email 注释。
我的资源包文件中有Email = {0} is not a well-formed email address,当用户在电子邮件字段中输入foo 时,它会显示email is not a well-formed email address。
是否可以生成输入的值并将其显示在错误消息中?
我正在使用带有 Spring MVC 3 的 Hibernate 3.5。
谢谢。
【问题讨论】:
标签: spring-mvc validation hibernate-validator