code: public ProjectStage getProjectStage()
      {
          Application application = getMyfacesApplicationInstance();
          if (application != null)
          {
              return application.getProjectStage();
          }
          throw new UnsupportedOperationException();
      }
docs: <p>
  Return the project stage for the currently running application instance. The default value is <code>
  {@link ProjectStage#Production}</code>
  </p>
  
  <p>
  The implementation of this method must perform the following algorithm or an equivalent with the same end result
  to determine the value to return.
  </p>
  
  <ul>
  <li>If the value has already been determined by a previous call to this method, simply return that value.</li>
  <li>Look for a <code>JNDI</code> environment entry under the key given by the value of
  <code>{@link ProjectStage#PROJECT_STAGE_JNDI_NAME}</code> (return type of java.lang.String). If found, continue
  with the algorithm below, otherwise, look for an entry in the <code>initParamMap</code> of the
  <code>ExternalContext</code> from the current <code>FacesContext</code> with the key
  <code>{@link ProjectStage#PROJECT_STAGE_PARAM_NAME}</code></li>
  <li>If a value is found found, see if an enum constant can be obtained by calling
  <code>ProjectStage.valueOf()</code>, passing the value from the <code>initParamMap</code>. If this succeeds
  without exception, save the value and return it.</li>
  <li>If not found, or any of the previous attempts to discover the enum constant value have failed, log a
  descriptive error message, assign the value as <code>ProjectStage.Production</code> and return it.</li>
  </ul>
  
  @since 2.0