Now, if you declare injectable URL in controller, it is compiled class URL. Compiled class URL is also passed to initialize method, if controller implements Initializable.
Looks like it will be better to return fxml file URL here, as fxml files should be included to resulting jar or native-image, because loaders search logic heavily relies on fxml files URLs anyway (for compatibility reasons).
Using fxml files URLs instead of class ones can free us from including compiled .class files in native-image's resource-config.json. fxml files are included there by gluonfx-maven-plugin by default. Here is gluonfx-maven-plugin's default resource config:
Now, if you declare injectable URL in controller, it is compiled class URL. Compiled class URL is also passed to
initialize
method, if controller implementsInitializable
.Looks like it will be better to return fxml file URL here, as fxml files should be included to resulting jar or native-image, because loaders search logic heavily relies on fxml files URLs anyway (for compatibility reasons).
Using fxml files URLs instead of class ones can free us from including compiled
.class
files in native-image'sresource-config.json
. fxml files are included there bygluonfx-maven-plugin
by default. Here isgluonfx-maven-plugin
's default resource config: