I've been fooling around with an extended ValidationMetadataProvider to see how hard it'd be to keep validation information tied to persisted entity objects instead of actions. Is there any other work like this going on?
The premise is that entity instances may show up as properties of many action beans, and so it'd be a good thing to avoid replicating the validation rules in each action. Even when the entities themselves don't appear directly as action properties, it may often be the case that the validation rules for scalar action properties are determined by the nature of related entities. Thus I've added a "@ValidateFrom(beanclass=Foo.class)" annotation. The provider just walks up that class's parentage gathering up @Validate information. It also looks at JPA @Column annotations to get a "maxlength" value if none is present in the @Validate. It really wasn't that hard to do because the mechanism is so nice and simple to begin with. -- Turtle, turtle, on the ground, Pink and shiny, turn around. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
