tags:

views:

40

answers:

2

For instance, I am using JSF + custom framework developed in our company. Now I want to use a third party validation framework that can be used as an plug-in and it should not create any dependency what ever may be the technical stack.

So my question is does spring provide any framework of that sort or if it's available how can I use that?

I am expecting a validation framework something like, which is configurable through XML.

A: 

Spring does have a validation framework, but if you want minimal dependencies, then I'd suggest that you go with a Bean validation provider. It's a new(ish) official validation standard, defined in JSR-303.

There are several implementations at the moment. I'd give Hibernate Validator a look.

GaryF
gary thanks for the suggestion but i am expecting a spring validation without using springmvc. Does JSR-303 provides thesolution what i a m looking for.
mahesh kumar
Actually we are using JSF+JobossEsB appication so will JSR 303 fit in all the layesrs of vaidation like we use webservices and also we send and get information from GDS adapter in our application so can i validate the request and response using JSR 303
mahesh kumar
@mahesh: JSR-303 validators don't depend on Spring at all (though spring does provide a suitable validator). JSR-303 is integrated into JSF and can easily be used with JBoss apps. So, yes, it'll do what you want.
GaryF
thank u . so you mean to say if am using JSF then i can use JSR303 standard ? and what about spring validation framework can i use it with out spring MVC.
mahesh kumar
A: 

I disagree. Hibernate Validator is an awful piece of software (at least the versions that were current about a year ago). Spring Validation is a nice piece of software, that goes together well with the BeanWrapper interface.

But it's true: Spring Hibernate resides inside the Spring Context jar, which is unnecessary overhead. Hopefully there will be a separate version sometime.

seanizer
It's changed a lot in the last year, since becoming JSR-303 compliant. Version 4.0 onwards are worth a look.It's worth mentioning that Spring Validation also works as a JSR-303 provider these days.Both are fine (they're pretty similar from a user perspective these days), but Spring Validation comes with more dependencies. If you're already using Spring, that's fine.
GaryF
thanks, I'll have a look at it some time
seanizer