Kevin Rave Kevin Rave - 1 year ago 476
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download