On 5/10/07, Al Maw <[EMAIL PROTECTED]> wrote:
Ryan Sonnek wrote:
> I'd appreciate anyone interested to take a look and let me know what
> they think.
You currently setRequired(true) on a NotEmpty, which isn't what that
intends at all.
It's purpose is to make sure a String is length > 0, or a collection has
more than zero elements.
Might not be correct for collections, but should work for strings right?
Similarly, the Length element can and probably should be using a
StringValidator for a TextField and not setting maxlength. Maybe it
should do both. ;-)
I've thought about using validators here and "ideally" would use a
StringValidatorWithBehavior that would automatically attach the markup
attributes. any thoughts?
It strikes me we probably need a:
Hibernate Validator Attribute + Component type -> Validator mapping
...because what sort of validator you want to use will be dependent on
the component type.
Al
I actually think I would like to create a application component
listener for this (similar to the SpringBean component listener) so
that an entire application will "just work" and you don't have to
worry about manually adding validators at all. thoughts?
Ryan