Skip to content

Commit

Permalink
Improve one time only runtime check if MyFaces is in use
Browse files Browse the repository at this point in the history
Issue: SWF-1705
  • Loading branch information
rstoyanchev committed Jul 31, 2017
1 parent f0373aa commit 75c9354
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.springframework.faces.webflow;

import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextWrapper;

import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
Expand Down Expand Up @@ -124,6 +125,9 @@ public static boolean isMyFacesInUse() {
if (facesContext == null) {
return false;
}
while (facesContext instanceof FacesContextWrapper) {
facesContext = ((FacesContextWrapper) facesContext).getWrapped();
}
myFacesInUse = facesContext.getClass().getPackage().getName().startsWith("org.apache.myfaces.");
}
return myFacesInUse;
Expand Down

0 comments on commit 75c9354

Please sign in to comment.