com.sun.rave.web.ui.appbase
Class AbstractPageBean

java.lang.Object
  extended bycom.sun.rave.web.ui.appbase.FacesBean
      extended bycom.sun.rave.web.ui.appbase.AbstractPageBean

public abstract class AbstractPageBean
extends FacesBean

AbstractPageBean is the abstract base class for every page bean associated with a JSP page containing JavaServer Faces components. It extends FacesBean, so it inherits all of the default integration behavior found there.

In addition to event handler methods that you create while building your application, the runtime environment will also call the following lifecycle related methods at appropriate points during the execution of your application:

For advanced users, and as a carry forward from previous versions of Sun Java Studio Creator, page bean instances are also registered automatically as a JavaServer Faces PhaseListener. For each lifecycle phase, there is an appropriate "before" and "after" event method, which you can override to provide phase-specific behavior. For example, if you wanted to provide some special logic that happened before or after the Update Model Values phase, you would override one of the methods:

   public void beforeUpdateModelValues();
   public void afterUpdateModelValues();
 


Constructor Summary
AbstractPageBean()
          Construct a new instance of this bean.
 
Method Summary
protected  void afterApplyRequestValues()
           
protected  void afterInvokeApplication()
           
 void afterPhase(javax.faces.event.PhaseEvent event)
          Call through to the appropriate "after event" method, depending upon the PhaseId in this event.
protected  void afterProcessValidations()
           
protected  void afterRenderResponse()
           
protected  void afterRestoreView()
           
protected  void afterUpdateModelValues()
           
protected  void beforeApplyRequestValues()
           
protected  void beforeInvokeApplication()
           
 void beforePhase(javax.faces.event.PhaseEvent event)
          Call through to the appropriate "before event" method, depending upon the PhaseId in this event.
protected  void beforeProcessValidations()
           
protected  void beforeRenderResponse()
           
protected  void beforeRestoreView()
           
protected  void beforeUpdateModelValues()
           
 void destroy()
          Callback method that is called after rendering is completed for this request, if init() was called, regardless of whether or not this was the page that was actually rendered.
 void init()
          Callback method that is called whenever a page is navigated to, either directly via a URL, or indirectly via page navigation.
protected  boolean isPostBack()
          Return true if the current request was a post back for an existing view, rather than the creation of a new view.
 void preprocess()
          Callback method that is called after the component tree has been restored, but before any event processing takes place.
 void prerender()
          Callback method that is called just before rendering takes place.
protected  void renderResponse()
          Skip any remaining request processing lifecycle phases for the current request, and go immediately to Render Response phase.
protected  void responseComplete()
          Skip any remaining request processing lifecycle phases for the current request, including Render Response phase.
 
Methods inherited from class com.sun.rave.web.ui.appbase.FacesBean
erase, error, error, fatal, fatal, getApplication, getApplicationMap, getBean, getCachedExceptions, getContext, getExternalContext, getFacesContext, getLifecycle, getRequestMap, getSessionMap, getValue, info, info, log, log, setBean, setValue, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPageBean

public AbstractPageBean()

Construct a new instance of this bean.

Method Detail

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)

Call through to the appropriate "before event" method, depending upon the PhaseId in this event.

Parameters:
event - PhaseEvent to be processed

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)

Call through to the appropriate "after event" method, depending upon the PhaseId in this event.

Parameters:
event - PhaseEvent to be processed

beforeRestoreView

protected void beforeRestoreView()

afterRestoreView

protected void afterRestoreView()

beforeApplyRequestValues

protected void beforeApplyRequestValues()

afterApplyRequestValues

protected void afterApplyRequestValues()

beforeProcessValidations

protected void beforeProcessValidations()

afterProcessValidations

protected void afterProcessValidations()

beforeUpdateModelValues

protected void beforeUpdateModelValues()

afterUpdateModelValues

protected void afterUpdateModelValues()

beforeInvokeApplication

protected void beforeInvokeApplication()

afterInvokeApplication

protected void afterInvokeApplication()

beforeRenderResponse

protected void beforeRenderResponse()

afterRenderResponse

protected void afterRenderResponse()

isPostBack

protected boolean isPostBack()

Return true if the current request was a post back for an existing view, rather than the creation of a new view. The result of this method may be used to conditionally execute one time setup that is only required when a page is first displayed.


renderResponse

protected void renderResponse()

Skip any remaining request processing lifecycle phases for the current request, and go immediately to Render Response phase. This method is typically invoked when you want to throw away input values provided by the user, instead of processing them.


responseComplete

protected void responseComplete()

Skip any remaining request processing lifecycle phases for the current request, including Render Response phase. This is appropriate if you have completed the response through some means other than JavaServer Faces rendering.


init

public void init()

Callback method that is called whenever a page is navigated to, either directly via a URL, or indirectly via page navigation. Override this method to acquire resources that will be needed for event handlers and lifecycle methods, whether or not this page is performing post back processing.

The default implementation does nothing.


preprocess

public void preprocess()

Callback method that is called after the component tree has been restored, but before any event processing takes place. This method will only be called on a "post back" request that is processing a form submit. Override this method to allocate resources that will be required in your event handlers.

The default implementation does nothing.


prerender

public void prerender()

Callback method that is called just before rendering takes place. This method will only be called for the page that will actually be rendered (and not, for example, on a page that handled a post back and then navigated to a different page). Override this method to allocate resources that will be required for rendering this page.

The default implementation does nothing.


destroy

public void destroy()

Callback method that is called after rendering is completed for this request, if init() was called, regardless of whether or not this was the page that was actually rendered. Override this method to release resources acquired in the init(), preprocess(), or prerender() methods (or acquired during execution of an event handler).

The default implementation does nothing.