[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-219) Consider interpolating the value in error messages

Gunnar Morling (JIRA) noreply at atlassian.com
Mon Aug 1 15:03:04 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43152#comment-43152 ] 

Gunnar Morling commented on BVAL-219:
-------------------------------------

Hibernate Validator's [ValueFormatterMessageInterpolator|http://docs.jboss.org/hibernate/validator/4.2/api/index.html?org/hibernate/validator/messageinterpolation/ValueFormatterMessageInterpolator.html] allows to specify a [format string|http://download.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax] which is used for formatting the validate value like this: {{$\{validatedValue:\[format string\]\}}}, e.g. {{$\{validatedValue:%1$ty\}}}. See also the [related section|http://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#section-message-interpolator] in the reference guide.

I've heard requests for this feature several times so we should definitely add some support for this IMO.

> Consider interpolating the value in error messages
> --------------------------------------------------
>
>                 Key: BVAL-219
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-219
>             Project: Bean Validation
>          Issue Type: New Feature
>            Reporter: Emmanuel Bernard
>
> The main drawback is that there is no formatting and that we will call value.toString() to resolve the value into string.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list