[OmniFaces utilities] The
isRichFacesInstalled()
method returns true
if RichFaces 4.x is installed. That is, when the RichFaces 4.0-4.3 specific ExtendedPartialViewContextImpl
, or RichFaces 4.5+ specific ExtendedPartialViewContext
is present in the runtime classpath. As this is usually auto-registered, we may safely assume that RichFaces 4.x is installed.Note RichFaces 4.4 doesn't exist.
Method:
Usage:
So, in order to find out if RichFaces 4.x is installed or not, just invoke Hacks#isRichFacesInstalled() method:
import org.omnifaces.util.Hacks;
...
// e.g. false, if RichFaces 4.x is not installed
// e.g. false, if RichFaces 4.x is not installed
boolean isRichFacesAvailable = Hacks.isRichFacesInstalled();
if(isRichFacesAvailable){
// looks like RichFaces 4.x is installed
} else {
// looks like RichFaces 4.x is not installed
}
Niciun comentariu :
Trimiteți un comentariu