[jboss-user] [JBoss Seam] - Re: Complex validation
wsollers
do-not-reply at jboss.com
Sun Feb 11 15:05:57 EST 2007
Could you:
| @ValidatorClass ( GreaterThanValidator.class )
| @Retention ( RetentionPolicy.RUNTIME )
| @Target ( { ElementType.METHOD } )
| public @interface GreaterThan {
|
| String elExpr = null;
| String mesg = "#{someMessageKey}";
|
| }
|
And then in the validator class get a reference to the Seam interpolator and invoke the el-binding cast it to Comparable and compare it to the annotated data element.
Could do the same for less than, either or, just a thought for the simpler things. To do entity exists checks I use a custom interceptor that has access to the entity manager to do the queries.
I am curious about this as well as I have lot's of these kind of things floating around and would really like to standardize them and will research it further.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014625#4014625
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014625
More information about the jboss-user
mailing list