Considering the following resource method:
@Controller
@GET
@View("foo.jsp")
public void prepareView() {
models.put("greeting", "hello");
}
The KrazoCdiExtension.processAnnotatedType(ProcessAnnotatedType<T> pat) method will automatically add the ValidationInterceptorBinding annotation in order to have the ValidationInterceptor.validateMethodInvocation(InvocationContext) method invoked for controller property validation and controller method parameter validation.
The Bean Validation API has an annotation called javax.validation.executable.ValidateOnExecution which makes it possible to control validation behavior by annotating classes, constructors, and methods. For more information, see:
I would like to propose adding support for @ValidateOnExecution(type = ExecutableType.NONE) on resource methods. For example:
@Controller
@GET
@View("foo.jsp")
@ValidateOnExecution(type = ExecutableType.NONE)
public void prepareView() {
models.put("greeting", "hello");
}
When present, Krazo would not add the ValidationInterceptorBinding annotation to the method. This would improve performance for execution of resource methods that do not need validation.
Thoughts?
Thanks,
-- Neil