You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jason Bell <ja...@e-gineering.com> on 2008/01/02 21:40:49 UTC

Commons Validator and Annotations

Greetings,

I'm looking to skip the xml configuration of validation and instead read the rules from annotations.  We're using hibernate objects throughout the app, even for the form.  And we're using annotations to configure all of the hibernate goodness.  So, we'd like to just go ahead and use these annotations to build our validation - maxlengths, number formats, required, etc.  Has anyone out there done this (or know of an open source project that has)?


Thanks!

Jason

RE: Commons Validator and Annotations

Posted by Jason Bell <ja...@e-gineering.com>.
Well, yes, of course.

However, that javascript is generated via a custom tag (which brings us back to Java).  The tag reads the config from the xml file.  And back to my original question - has anyone attempted (or knows of another project) which instead determines the config based on annotations rather than an XML file?  I can go ahead and do it, but would rather not reinvent the wheel if it's already out there some where.

Cheers,
Jason  



-----Original Message-----
From: apacheben@gmail.com on behalf of Ben Speakmon
Sent: Wed 1/2/2008 4:19 PM
To: Jakarta Commons Users List
Subject: Re: Commons Validator and Annotations
 
Client-side means browser, which means javascript, right? In that case, it's
not even Java anymore.

On Jan 2, 2008 1:13 PM, Jason Bell <ja...@e-gineering.com> wrote:

> We want to use the client-side validation aspect of Commons Validator.
>  We're using it in other webapps, but in our newest endeavor, we'd like to
> centralize the config info.
>
> Thanks,
> Jason
>
>
> -----Original Message-----
> From: apacheben@gmail.com on behalf of Ben Speakmon
> Sent: Wed 1/2/2008 4:12 PM
> To: Jakarta Commons Users List
> Subject: Re: Commons Validator and Annotations
>
> If you already have annotations at your hibernate layer to do validation,
> why do you want to do it again somewhere else? Or are you talking about
> validating different data than what gets stuffed into hibernate?
>
> On Jan 2, 2008 12:40 PM, Jason Bell <ja...@e-gineering.com> wrote:
>
> >
> > Greetings,
> >
> > I'm looking to skip the xml configuration of validation and instead read
> > the rules from annotations.  We're using hibernate objects throughout
> the
> > app, even for the form.  And we're using annotations to configure all of
> the
> > hibernate goodness.  So, we'd like to just go ahead and use these
> > annotations to build our validation - maxlengths, number formats,
> required,
> > etc.  Has anyone out there done this (or know of an open source project
> that
> > has)?
> >
> >
> > Thanks!
> >
> > Jason
> >
>
>


Re: Commons Validator and Annotations

Posted by Ben Speakmon <bs...@apache.org>.
Client-side means browser, which means javascript, right? In that case, it's
not even Java anymore.

On Jan 2, 2008 1:13 PM, Jason Bell <ja...@e-gineering.com> wrote:

> We want to use the client-side validation aspect of Commons Validator.
>  We're using it in other webapps, but in our newest endeavor, we'd like to
> centralize the config info.
>
> Thanks,
> Jason
>
>
> -----Original Message-----
> From: apacheben@gmail.com on behalf of Ben Speakmon
> Sent: Wed 1/2/2008 4:12 PM
> To: Jakarta Commons Users List
> Subject: Re: Commons Validator and Annotations
>
> If you already have annotations at your hibernate layer to do validation,
> why do you want to do it again somewhere else? Or are you talking about
> validating different data than what gets stuffed into hibernate?
>
> On Jan 2, 2008 12:40 PM, Jason Bell <ja...@e-gineering.com> wrote:
>
> >
> > Greetings,
> >
> > I'm looking to skip the xml configuration of validation and instead read
> > the rules from annotations.  We're using hibernate objects throughout
> the
> > app, even for the form.  And we're using annotations to configure all of
> the
> > hibernate goodness.  So, we'd like to just go ahead and use these
> > annotations to build our validation - maxlengths, number formats,
> required,
> > etc.  Has anyone out there done this (or know of an open source project
> that
> > has)?
> >
> >
> > Thanks!
> >
> > Jason
> >
>
>

RE: Commons Validator and Annotations

Posted by Jason Bell <ja...@e-gineering.com>.
We want to use the client-side validation aspect of Commons Validator.  We're using it in other webapps, but in our newest endeavor, we'd like to centralize the config info.

Thanks,
Jason


-----Original Message-----
From: apacheben@gmail.com on behalf of Ben Speakmon
Sent: Wed 1/2/2008 4:12 PM
To: Jakarta Commons Users List
Subject: Re: Commons Validator and Annotations
 
If you already have annotations at your hibernate layer to do validation,
why do you want to do it again somewhere else? Or are you talking about
validating different data than what gets stuffed into hibernate?

On Jan 2, 2008 12:40 PM, Jason Bell <ja...@e-gineering.com> wrote:

>
> Greetings,
>
> I'm looking to skip the xml configuration of validation and instead read
> the rules from annotations.  We're using hibernate objects throughout the
> app, even for the form.  And we're using annotations to configure all of the
> hibernate goodness.  So, we'd like to just go ahead and use these
> annotations to build our validation - maxlengths, number formats, required,
> etc.  Has anyone out there done this (or know of an open source project that
> has)?
>
>
> Thanks!
>
> Jason
>


Re: Commons Validator and Annotations

Posted by Ben Speakmon <bs...@apache.org>.
If you already have annotations at your hibernate layer to do validation,
why do you want to do it again somewhere else? Or are you talking about
validating different data than what gets stuffed into hibernate?

On Jan 2, 2008 12:40 PM, Jason Bell <ja...@e-gineering.com> wrote:

>
> Greetings,
>
> I'm looking to skip the xml configuration of validation and instead read
> the rules from annotations.  We're using hibernate objects throughout the
> app, even for the form.  And we're using annotations to configure all of the
> hibernate goodness.  So, we'd like to just go ahead and use these
> annotations to build our validation - maxlengths, number formats, required,
> etc.  Has anyone out there done this (or know of an open source project that
> has)?
>
>
> Thanks!
>
> Jason
>