Spring Web Flow

org.springframework.faces.webflow
Class FacesContextHelper

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

public class FacesContextHelper
extends java.lang.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 Summary
FacesContextHelper()
           
 
Method Summary
 javax.faces.context.FacesContext getFacesContext(java.lang.Object context, java.lang.Object request, java.lang.Object response)
          Returns a faces context that can be used outside of Web Flow.
static javax.faces.context.FacesContext newDefaultInstance(java.lang.Object context, java.lang.Object request, java.lang.Object response, javax.faces.lifecycle.Lifecycle lifecycle)
          Factory method that can be used to create a new default FacesContext instance for the running (Portlet/Servlet) environment.
 void releaseIfNecessary()
          Release any previously obtained FacesContext if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesContextHelper

public FacesContextHelper()
Method Detail

getFacesContext

public javax.faces.context.FacesContext getFacesContext(java.lang.Object context,
                                                        java.lang.Object request,
                                                        java.lang.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:
getFacesContext(Object, Object, Object)

newDefaultInstance

public static javax.faces.context.FacesContext newDefaultInstance(java.lang.Object context,
                                                                  java.lang.Object request,
                                                                  java.lang.Object response,
                                                                  javax.faces.lifecycle.Lifecycle lifecycle)
Factory method that can be used to create a new default FacesContext instance for the running (Portlet/Servlet) environment.

Parameters:
context - the native context
request - the native request
response - the native response
lifecycle - the JSF lifecycle
Returns:
a new FacesContext instance

Spring Web Flow