[
https://issues.apache.org/jira/browse/MYFACES-4307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959603#comment-16959603
]
Cédric Servais commented on MYFACES-4307:
-----------------------------------------
Small, update, I've found out that "Dependent" wasn't necessary in this case.
For the FacesConfig, I've added a faces-config.xml in my WEB-INF directory but
not luck so far.
> FacesValidator seems to not be working as expected
> --------------------------------------------------
>
> Key: MYFACES-4307
> URL: https://issues.apache.org/jira/browse/MYFACES-4307
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 2.3.4
> Environment: Apache Netbeans 11.1
> OpenJDK 12
> Windows 10
> Apache TomEE Plus 8.0
> MyFaces 2.3.4
> OpenWebbeans 2.0.9
> Reporter: Cédric Servais
> Priority: Major
> Attachments: UserExistValidator.java
>
>
> Hello,
> I've generated a basic FacesValidator which uses CDI to retrieve FacesContext
> and other Container Managed-Bean.
> I've noted several issues while doing so:
> * @FacesValidator with "managed = true" isn't enough to make this Validator
> a managed-bean being "Injectable".
> * @Dependent (or any other scope) must be added to workaround the previous
> point.
> * If you want to inject FacesContext as described in JSF 2.3 spec, you also
> need to add @FacesConfig(version = FacesConfig.Version.JSF_2_3), without that
> setting, injecting a FacesContext will result in NullPointerException.
>
> It may be that not all of this is related to MyFaces or that I misunderstood
> some part of the JSF 2.3 specs but I'm not able to run the attachec validator
> without these additions.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)