Hi
I have @Advanced on my validator. Is there extra config required for CODI?
I only copied the jars into WEB-INF/lib folder.
@ApplicationScoped
@Advanced
public class NameUniqueValidator implements
ConstraintValidator<NameUnique, String>, Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Inject
private UserService service;
@Override
public void initialize(NameUnique arg0) {
}
@Override
public boolean isValid(String name, ConstraintValidatorContext context)
{
return service.isNameValid(name);
}
}
Regards,
YaoCL
On Fri, Sep 14, 2012 at 4:18 PM, Thomas Andraschko <[email protected]> wrote:
> Hi,
>
> did you try @Advanced on your validator?
> This is required if you did not deactivate it via config.
>
> Regards,
> Thomas
>
>
> 2012/9/14 Yaocl <[email protected]>
>>
>> Hi
>>
>> I can't figure out how to make CODI Bean Validation modules work. I
>> have a custom constraint require query db.
>> I have put all CODI jar files in my WEB-INF/lib folder. But @Inject
>> not work in my custom validator.
>>
>> My java server is TomEE+ 1.1 snapshot. I tried to debug it, Both JSF
>> and JPA using default Validator Factory.
>>
>> Can someone give me a example of using CODI BV module?
>>
>>
>> --
>> YaoCL
>
>