Open chkal opened 9 years ago
Comment by Christian Kaltepoth:
I basically agree that having to use @ValidateOnExecution isn't very nice. And the reason why users have to add this annotation is hard to understand.
However, I currently see no way to fix this on the MVC side. :(
Original issue MVC_SPEC-54 created by lefloh:
Currently it's necessary to disable bean validation to ensure MVC can validate and call a controller method if validation fails. This can be done globally in the validation.xml or per @ValidateOnExecution annotation on every method.
Disabling BV globally has the disadvantage that you disable it also for non MVC controllers. Using the annotation is not very self explanatory:
It's hard to guess why something must be valid but should not be validated. Not everybody will understand the background or read the spec.
Would a custom annotation like @MvcValidated make sense? It would at least make it clear that something MVC related happens independent of the BV settings.