-
1. Re: Parameter replacement in Hibernate Validator messages
joblini Jul 18, 2008 6:11 PM (in response to joblini)I have managed to personalize the message somewhat, by using EL in the message bundle:
messages.properties: validator.email=#{messages['label.EMAIL']} : not a well-formed email address
Then, I define the lable in another resource bundle associated with the view:
ClientEdit.properties: label.EMAIL=Client Email
This approach won't work if the same validation is used for two or more fields on the same page.
Can anyone help me with this? JSF and Struts/Tiles support this
out of the box
.Thanks in advance!
-
3. Re: Parameter replacement in Hibernate Validator messages
joblini Sep 24, 2008 4:15 AM (in response to joblini)
Pete Muir wrote on Jul 30, 2008 13:48:
http://www.hibernate.org/hib_docs/validator/reference/en/html/validator-defineconstraints.html#validator-defineconstraints-errorHello, thanks for your reply.
If I understand correctly, you are not saying RTFM, but rather, that the solution is to write a custom interpolator? I was hoping that Seam might support this use case out of the box, that is, to include the label for an input in the error messages, as JSF does. I am referring to the {0} parameter in a JSF resource bundle message for a validation error.
Thanks!
PS Keep up the great work on Seam, looking forward to 2.1CR :-)