final ValidationErrors errors = ctx.getActionBeanContext().getValidationErrors();
final ActionBean bean = ctx.getActionBean();
final Method handler = ctx.getHandler();
final boolean doBind = handler != null && handler.getAnnotation(DontBind.class) == null;
final boolean doValidate = doBind && handler.getAnnotation(DontValidate.class) == null;
Configuration config = StripesFilter.getConfiguration();
// Run the bean's methods annotated with @ValidateMethod if the following conditions are met:
// l. This event is not marked to bypass binding
// 2. This event is not marked to bypass validation (doValidate == true)
// 3. We have no errors so far OR alwaysInvokeValidate is true
if (doValidate) {
ctx.setLifecycleStage(LifecycleStage.CustomValidation);
ctx.setInterceptors(config.getInterceptors(LifecycleStage.CustomValidation));
return ctx.wrap( new Interceptor() {
public Resolution intercept(ExecutionContext context) throws Exception {
// Run any of the annotated validation methods
Method[] validations = findCustomValidationMethods(bean.getClass());