[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
}
Niciun comentariu :
Trimiteți un comentariu