Support for container injection in ConstraintValidator

Description

It should be possible to inject beans in implementations of javax.validation.ConstraintValidator.
E.g. MyFaces CODI supports it already for CDI (https://issues.apache.org/jira/browse/EXTCDI-20), however as mentioned in http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-763 a generic support would have to support JSR-330 (instead of JSR-299). The final approach has to be coordinated with all other JSRs which are going to provide such an injection support.

Environment

None

Activity

Show:
Gunnar Morling
August 31, 2011, 8:46 PM

I'd definitely like to see some sort of DI support for constraint validators.

I'm not sure thought what we could do to achieve this from a Bean Validation point of view. Wouldn't that be the responsibility of the DI container? Spring already has support for this and for CDI there is besides CODI also Seam Validation. It might be a good idea to standardize that in the CDI spec.

Maybe you could provide some more information on the kind of support you have in mind?

Gerhard Petracek
August 31, 2011, 8:57 PM

This issue is like a placeholder for this topic. As mentioned in http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-763 spec leads should discuss this topic with the EG of the platform JSR.

Assignee

Emmanuel Bernard

Reporter

Gerhard Petracek

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major
Configure