code: private boolean isFacelets2Enabled(FacesContext context)
      {
          String param = context.getExternalContext().getInitParameter(PARAM_DISABLE_JSF_FACELET);
          boolean facelets2ParamDisabled = (param != null && Boolean.parseBoolean(param.toLowerCase()));
          
          return !facelets2ParamDisabled;
      }
docs: Determines if the current application uses Facelets-2.
  To accomplish that it looks at the init param javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER,
  
  @param context the <code>FacesContext</code>
  @return <code>true</code> if the current application uses the built in Facelets-2,
  <code>false</code> otherwise (e.g. it uses Facelets-1 or only JSP).