I have a controller with the following properties:
@ManagedProperty(value="#{remoteApplication}")
private transient ProcessService applicationService;
@ManagedProperty(value="#{remoteSystem}")
private transient SystemService systemService;
@ManagedProperty(value="#{remoteFileSystem}")
private transient FileSystemService fileSystemService;
I would like to inject beans conditionally, according to a property file telling if the services shall be local or remote.
Example provided hereabove is for remote, and for local, would be:
@ManagedProperty(value="#{localApplication}")
private transient ProcessService applicationService;
@ManagedProperty(value="#{localSystem}")
private transient SystemService systemService;
@ManagedProperty(value="#{localFileSystem}")
private transient FileSystemService fileSystemService;
Is there any way to do this with JSF (maybe using ValueExpression
as specified in ManagedProperty documentation) ? Or do I have to use CDI ?
Many thanks in advance for your suggestions!
Kind regards,
Zim