You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Cédric Servais (Jira)" <de...@myfaces.apache.org> on 2019/10/25 08:54:00 UTC

[jira] [Created] (MYFACES-4307) FacesValidator seems to not be working as expected

Cédric Servais created MYFACES-4307:
---------------------------------------

             Summary: 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
         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)