neoremind / fluent-validator

A Java validation framework leveraging fluent interface style and JSR 303 specification
Apache License 2.0
1.02k stars 222 forks source link

使用Aop形式校验为什么不走hibernate validator? #39

Closed lwshiwook closed 5 years ago

lwshiwook commented 5 years ago

使用api形式先校验,result是

Result{isSuccess=false, errors=[xxxxxxx]}

但是用aop形式就会打印

Annotation-based validation enabled for ArticleWithContent, and to-do validators are empty

然后校验通过,何解?

附上我的配置方式

    @Bean(name="fluentValidateInterceptor")
public FluentValidateInterceptor interceptor() {
    FluentValidateInterceptor interceptor = new FluentValidateInterceptor();
    interceptor.setCallback(callback);
    return interceptor;
}

@Bean
public BeanNameAutoProxyCreator transactionAutoProxy() {
    BeanNameAutoProxyCreator transactionAutoProxy = new BeanNameAutoProxyCreator();
    transactionAutoProxy.setBeanNames("*ServiceImpl");
    transactionAutoProxy.setInterceptorNames("fluentValidateInterceptor");
    return transactionAutoProxy;
}
lwshiwook commented 5 years ago

我的错,没有指定groups