Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Bug
-
2.3.4
-
None
-
None
-
Apache Netbeans 11.1
OpenJDK 12
Windows 10
Apache TomEE Plus 8.0
MyFaces 2.3.4
OpenWebbeans 2.0.9
Description
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.