Thanks Smies. I guess I should give myself a RTFM. Oh well. I have read that documentation
and found something very useful. To achieve my desired behaviour the notation is
@NotNull
@Length(min = 2, message="{person.lastName.length}"))
public String getLastName()
{
return lastName;
}
Notice the squiggly brackets around the property in apostrohies!
However to make this actually work well you need a very bad setup. You need to have the
Hibernate ValidatorMessages.properties files as well as the Seam messages.properties
files to exist and contain all properties. If you only use the beans via Seam you can get
away with the ValidatorMessages files only containing empty property definitions like
this
validator.length=
so that at least you still have only one resource bundle with all the i18n texts.
As an alternative for now I am thinking of copying the message.properties files to
ValidatorMessage.properties files as part of the build but surely there must be a better
way.
Once we have a proper way this should go into the Seam wiki and one of the examples I
suppose (or the upcoming book). I am happy to help with that.
manfred
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965818#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...