users@jersey.java.net

Using JSR-303 (bean validation) with Jersey

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Fri, 10 Apr 2009 09:25:22 -0700

Quick question: I am planning to use hibernate-validation (impl of
JSR-303) with my Jersey service, and it looks like a very good match
if things work as planned. I can do this easily from my resources, and
that's good enough for immediate use.

But it also seems like aspect that could be quite easily added to
generic handling: for example, if bound input argument fails
validation, a 4xx error could be returned.

So I was wondering if:

(a) There is already a natural place for hooking this in (by adding a filter?)
(b) If not, is this something for which a simple hook could be added.
Probably not JSR-303 specific.

-+ Tatu +-