Permalink
Browse files

Add Faces#getProjectStage()

  • Loading branch information...
BalusC committed Nov 28, 2016
1 parent 0c57bb5 commit 9b0c984e8e3df096f35718ff57d5df9d6a0bc921
Showing with 20 additions and 0 deletions.
  1. +12 −0 src/main/java/org/omnifaces/util/Faces.java
  2. +8 −0 src/main/java/org/omnifaces/util/FacesLocal.java
@@ -37,6 +37,7 @@
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.application.NavigationHandler;
import javax.faces.application.ProjectStage;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewParameter;
import javax.faces.component.UIViewRoot;
@@ -294,6 +295,17 @@ public static String getServerInfo() {
return FacesLocal.getServerInfo(getContext());
}
/**
* Returns the project stage. This will return the <code>javax.faces.PROJECT_STAGE</code> context parameter in
* <code>web.xml</code>.
* @return The project stage.
* @see Application#getProjectStage()
* @since 2.6
*/
public static ProjectStage getProjectStage() {
return FacesLocal.getProjectStage(getContext());
}
/**
* Returns whether we're in development stage. This will be the case when the <code>javax.faces.PROJECT_STAGE</code>
* context parameter in <code>web.xml</code> is set to <code>Development</code>.
@@ -154,6 +154,14 @@ public static String getServerInfo(FacesContext context) {
return getServletContext(context).getServerInfo();
}
/**
* {@inheritDoc}
* @see Faces#getProjectStage()
*/
public static ProjectStage getProjectStage(FacesContext context) {
return context.getApplication().getProjectStage();
}
/**
* {@inheritDoc}
* @see Faces#isDevelopment()

0 comments on commit 9b0c984

Please sign in to comment.