[OmniFaces utilities] The
isActive() returns true when the given CDI managed bean scope is active. I.e., all beans therein can be accessed without facing ContextNotActiveException.Method:
For example, you can test if the request scope is active like this:
import
org.omnifaces.util.Beans;
...
boolean
isrequestscopeactive = Beans.isActive(RequestScoped.class);
if (isrequestscopeactive){
// do something
} else {
// do something else
}







JSF 2 Tutorials at www.mkyong.com
JavaServer Faces (JSF) Tutorial 

















Niciun comentariu :
Trimiteți un comentariu