Skip to content

Commit

Permalink
Guard against JSF not being present
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3624 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Aug 31, 2009
1 parent 9ab3e2b commit 7c20f27
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions impl/src/main/java/org/jboss/webbeans/jsf/JsfApiAbstraction.java
Expand Up @@ -43,13 +43,16 @@ public JsfApiAbstraction(ResourceLoader resourceLoader)
this.UICOMPONENT_CLASS = classForName("javax.faces.component.UIComponent");
this.FACES_CONTEXT = classForName("javax.faces.context.FacesContext");
double version = 2.0;
try
if (this.FACES_CONTEXT != null)
{
this.FACES_CONTEXT.getMethod("isPostback", new Class[] {});
}
catch (NoSuchMethodException e)
{
version = 1.2;
try
{
this.FACES_CONTEXT.getMethod("isPostback", new Class[] {});
}
catch (NoSuchMethodException e)
{
version = 1.2;
}
}
MINIMUM_API_VERSION = version;
}
Expand Down

0 comments on commit 7c20f27

Please sign in to comment.