users@jersey.java.net

[Jersey] Re: DropWizard and Hibernate Validator

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 1 Nov 2012 17:38:30 -0700

On Thu, Nov 1, 2012 at 1:44 PM, cowwoc <cowwoc_at_bbs.darktech.org> wrote:
> Hi Tatu,
>
> I tried playing with DropWizard but now I'm getting frustrated with the
> component that I knew would annoy me: Hibernate Validator (I've had bad
> experiences with anything related to Hibernate).
>
> I created the sample application mentioned here:
> http://dropwizard.codahale.com/getting-started/
>
> But then I added the following method inside HelloWorldResource:
>
> private void foo(@NotNull @Valid String value) {
> System.out.println("*******************inside: " + value);
> }
>
> and I invoke foo(null) from sayHello(). I am expecting the validator to
> throw an exception since I am passing in null, but instead the calls
> continues as if nothing is wrong. What am I missing?

If you are calling it directly, there's nothing intercepting it. These
are validated by code that would call resource method?

-+ Tatu +-