Class FacesContextHelper

java.lang.Object
org.springframework.faces.webflow.FacesContextHelper

public class FacesContextHelper extends Object
Provides helper methods for getting a FacesContext that is suitable for use outside of Web Flow. Inside a running Flow session FlowFacesContext is typically used instead.
Since:
2.2.0
Author:
Rossen Stoyanchev, Phillip Webb
  • Constructor Details

    • FacesContextHelper

      public FacesContextHelper()
  • Method Details

    • getFacesContext

      public jakarta.faces.context.FacesContext getFacesContext(Object context, Object request, Object response)
      Returns a faces context that can be used outside of Web Flow. The context must be released after use.
      Parameters:
      context - the native context
      request - the native request
      response - the native response
      Returns:
      a FacesContext instance.
      See Also:
      • release
    • releaseIfNecessary

      public void releaseIfNecessary()
      Release any previously obtained FacesContext if necessary.
      See Also:
    • newDefaultInstance

      public static jakarta.faces.context.FacesContext newDefaultInstance(Object context, Object request, Object response, jakarta.faces.lifecycle.Lifecycle lifecycle)
      Factory method that can be used to create a new default FacesContext instance.
      Parameters:
      context - the native context
      request - the native request
      response - the native response
      lifecycle - the JSF lifecycle
      Returns:
      a new FacesContext instance