Details
-
Tracker
-
Resolution: Done
-
Major
-
None
-
None
Description
CDI should integrate with Bean Validation to support dependency injection within BV ConstraintValidator implementations.
From the BV 1.1 spec early draft:
Java EE should obey the rules defined above and enable Context and Dependency Injection (CDI) support to ValidatorFactory instances. In particular:
- Let Validator and ValidatorFactory object be injectable.
- Use a default ConstraintValidatorFactory implementation that returns CDI managed ConstraintValidator objects. The scope of these instances is dependent as the Bean Validation provider is responsible for them.
- Provide CDI managed instances of ConstraintValidatorFactory, MessageInterpolator and TraversableResovler if customized classes are requested in the XML deployment descriptor.