users@jersey.java.net

[Jersey] Re: Best way to validate request objects in jersey?

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Wed, 31 Oct 2012 20:27:38 -0400

     Out of curiosity, what's the benefit of using Dropwizard as opposed
to using the various technologies they mention by ourselves? I like most
of what's inside, but as soon as they start talking about YAML
configuration files, JDBI and Freemarker we go our separate ways :)

Thanks,
Gili

On 31/10/2012 8:10 PM, Tatu Saloranta wrote:
> On Wed, Oct 31, 2012 at 11:19 AM, Marek Potociar
> <marek.potociar_at_oracle.com> wrote:
>> The recommended way how to validate objects in Java in general is to use standard Bean Validation APIs. Unfortunately, neither Jersey nor JAX-RS provides a BV integration at the moment, so you may need to invoke the BV Validator manually yourself. At least for now. There are some plans to add BV support to JAX-RS, but nothing is fleshed out at the moment.
> In the meantime, I'd strongly suggest a look at:
>
> http://dropwizard.codahale.com/
>
> which already nicely integrates Bean Validation & Jersey. And in case
> JAX-RS would in future open up extension points to do the same, I'm
> sure DW could easily wire things using that.
>
> In case of DW, one then just annotates request POJOs with Bean
> Validation annotations and things "just work".
> Similar to JAX-RS databinding.
> And this can be used not just for data but also service configuration,
> which is totally awesome.
>
> -+ Tatu +-