com.icesoft.faces.webapp.xmlhttp
Class PersistentFacesState

java.lang.Object
  extended bycom.icesoft.faces.webapp.xmlhttp.PersistentFacesState

public class PersistentFacesState
extends java.lang.Object

The PersistentFacesState class allows the application to initiate rendering asynchronously and independently of user interaction.

Typical use is to obtain a PersistentFacesState instance in a managed bean constructor and then use that instance for any relevant rendering requests.


Method Summary
 javax.faces.context.FacesContext getFacesContext()
          Return the FacesContext associated with this instance.
static PersistentFacesState getInstance()
          Obtain the PersistentFacesState instance appropriate for the current context.
 void navigateTo(java.lang.String outcome)
          Redirect browser to a different page.
 void redirectTo(java.lang.String uri)
          Redirect browser to a different URI.
 void render()
          Render the view associated with this PersistentFacesState.
 void renderLater()
          Render the view associated with this PersistentFacesState.
 java.lang.String toString()
          Return a String representation of this PersistentFacesState instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static PersistentFacesState getInstance()
Obtain the PersistentFacesState instance appropriate for the current context. This is managed through InheritableThreadLocal variables. The recommended approach is to call this method from a mangaged-bean constructor and use the instance obtained for any render() requests.

Returns:
the PersistentFacesState appropriate for the calling Thread

getFacesContext

public javax.faces.context.FacesContext getFacesContext()
Return the FacesContext associated with this instance.

Returns:
the FacesContext for this instance

render

public void render()
            throws RenderingException
Render the view associated with this PersistentFacesState. The user's browser will be immediately updated with any changes.

Throws:
RenderingException

renderLater

public void renderLater()
Render the view associated with this PersistentFacesState. This takes place on a separate thread to guard against potential deadlock from calling render() during view rendering.


redirectTo

public void redirectTo(java.lang.String uri)
Redirect browser to a different URI. The user's browser will be immediately redirected without any user interaction required.

Parameters:
uri - the relative or absolute URI.

navigateTo

public void navigateTo(java.lang.String outcome)
Redirect browser to a different page. The redirect page is selected based on the navigation rule. The user's browser will be immediately redirected without any user interaction required.

Parameters:
outcome - the 'from-outcome' field in the navigation rule.

toString

public java.lang.String toString()

Return a String representation of this PersistentFacesState instance.