When using CDI to managed controllers, one can not mark a controller as @ApplicationScoped
because:
- @FXML on private fields do not get populated as the controller instance is a proxy instance which does not export private fields
- public fields can not be used as @ApplicationScoped does not allow for public fields
If FXML Loader inject Controller Fields via setter method a controller could be annotated as @ApplicationScoped
because:
- @FXML on private fields do not get populated as the controller instance is a proxy instance which does not export private fields
- public fields can not be used as @ApplicationScoped does not allow for public fields
If FXML Loader inject Controller Fields via setter method a controller could be annotated as @ApplicationScoped
- relates to
-
JDK-8255581 FXMLLoader - controller fields injection with proxies
- Open