Kevin Rave Kevin Rave - 4 months ago 88x
Java Question

@Valid annotation - This annotation disallowed for this location

I have controller method that has

annotation to enforce JSR303 Bean validation.

But when I just give
is shows"

This annotation @Valid is disallowed for this location

I can get rid of this by giving full package path
. It does not show the above message if I use this.

My question is, would there be any conflict that is forcing me to give full package name?
Or some jars missing?

I wouldn't be asking this question, if
validation is working fine. But its not working either, though there is no compile or run time error. It is just not triggering.

I posted this issue here in a different thread.


Take a look at your imports. I guess you are not importing javax.validation.Valid when you just use @Valid.