[OmniFaces utilities] The
getInstance()
returns the CDI managed bean instance (actual) of the given bean class and creates one if one doesn't exist and create
argument is true
, otherwise don't create one and return null
if there's no current instance.Method:
import org.omnifaces.util.Beans;
...
// in/out
CDI bean TestBean
// if the
second parameter is false and there's no current instance, then it will return
null
TestBean
testBean = Beans.getInstance(TestBean.class, true);
Niciun comentariu :
Trimiteți un comentariu