Skip to content

Commit 75c9354

Browse files
committed
Improve one time only runtime check if MyFaces is in use
Issue: SWF-1705
1 parent f0373aa commit 75c9354

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-faces/src/main/java/org/springframework/faces/webflow/JsfRuntimeInformation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.faces.webflow;
1818

1919
import javax.faces.context.FacesContext;
20+
import javax.faces.context.FacesContextWrapper;
2021

2122
import org.springframework.util.Assert;
2223
import org.springframework.util.ClassUtils;
@@ -124,6 +125,9 @@ public static boolean isMyFacesInUse() {
124125
if (facesContext == null) {
125126
return false;
126127
}
128+
while (facesContext instanceof FacesContextWrapper) {
129+
facesContext = ((FacesContextWrapper) facesContext).getWrapped();
130+
}
127131
myFacesInUse = facesContext.getClass().getPackage().getName().startsWith("org.apache.myfaces.");
128132
}
129133
return myFacesInUse;

0 commit comments

Comments
 (0)