Improve one time only runtime check if MyFaces is in use

Issue: SWF-1705
This commit is contained in:
Rossen Stoyanchev
2017-07-31 13:29:07 +02:00
parent 93e499332d
commit 9595f7f83c

View File

@@ -17,6 +17,7 @@
package org.springframework.faces.webflow;
import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextWrapper;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;
@@ -104,6 +105,9 @@ public class JsfRuntimeInformation {
if (facesContext == null) {
return false;
}
while (facesContext instanceof FacesContextWrapper) {
facesContext = ((FacesContextWrapper) facesContext).getWrapped();
}
myFacesInUse = facesContext.getClass().getPackage().getName().startsWith("org.apache.myfaces.");
}
return myFacesInUse;