|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.application.ViewHandler
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
public class ViewHandlerImpl
ViewHandler implementation that allows events to be triggered upon the
occurrence of specific ViewHandler method calls. This implementation also
posts relevant lifecycle events to initialized page beans, so it also
implements PhaseListener.
| Field Summary | |
|---|---|
static java.lang.String |
CACHED_EXCEPTIONS
Request attribute key under which a List of any
Exceptions thrown by a page bean event handler,
and then logged and swallowed, will be cached. |
static java.lang.String |
CREATED_VIEW
The UIViewRoot attribute under which we store
Boolean.TRUE when createView() is
called. |
static java.lang.String |
PAGE_BEANS_CREATED
Request attribute key under which a List of the
AbstractPageBeans that have been created for the current
request are stored. |
| Fields inherited from class javax.faces.application.ViewHandler |
|---|
CHARACTER_ENCODING_KEY, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME |
| Constructor Summary | |
|---|---|
ViewHandlerImpl(javax.faces.application.ViewHandler handler)
Construct a new ViewHandlerImpl that delegates to the
specified ViewHandler instance. |
|
| Method Summary | |
|---|---|
void |
afterPhase(javax.faces.event.PhaseEvent event)
Process the specified after phase event. |
void |
beforePhase(javax.faces.event.PhaseEvent event)
Process the specified before phase event. |
static void |
cache(javax.faces.context.FacesContext context,
java.lang.Exception exception)
Cache the specified exception in a request scope attribute that application logic can use to invoke error processing. |
java.util.Locale |
calculateLocale(javax.faces.context.FacesContext context)
Return an appropriate Locale to use for this
and subsequent requests for the current client. |
java.lang.String |
calculateRenderKitId(javax.faces.context.FacesContext context)
Return an appropriate RenderKit identifier
for this and subsequent requests from the current
client. |
javax.faces.component.UIViewRoot |
createView(javax.faces.context.FacesContext context,
java.lang.String viewId)
Create and return a new UIViewRoot instance
initialized with information from this FacesContext
for the specified viewId. |
java.lang.String |
getActionURL(javax.faces.context.FacesContext context,
java.lang.String viewId)
Return a URL suitable for rendering that selects the specified view identifier. |
javax.faces.event.PhaseId |
getPhaseId()
Return PhaseId.ANY_PHASE because we are interested
in all phase events. |
java.lang.String |
getResourceURL(javax.faces.context.FacesContext context,
java.lang.String path)
Return a URL suitable for rendering that selects the specified resource. |
static void |
record(javax.faces.context.FacesContext context,
AbstractPageBean bean)
Record the specified AbstractPageBean on the list of
page beans that have been , and therefore need to have their
beforePhase() and afterPhase() methods called at appropriate times. |
void |
renderView(javax.faces.context.FacesContext context,
javax.faces.component.UIViewRoot viewRoot)
Perform the necessary actions to render the specified view as part of the current response. |
javax.faces.component.UIViewRoot |
restoreView(javax.faces.context.FacesContext context,
java.lang.String viewId)
Perform necessary actions to restore the specified view and return a corresponding UIViewRoot. |
void |
writeState(javax.faces.context.FacesContext context)
Take appropriate action to save the current state information. |
| Methods inherited from class javax.faces.application.ViewHandler |
|---|
calculateCharacterEncoding, initView |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CACHED_EXCEPTIONS
Request attribute key under which a List of any
Exceptions thrown by a page bean event handler,
and then logged and swallowed, will be cached. Application
logic can check for such exceptions (perhaps during the
destroy() method), to invoke application specific
error processing.
public static final java.lang.String CREATED_VIEW
The UIViewRoot attribute under which we store
Boolean.TRUE when createView() is
called. This can be used by the isPostBack()
method to determine whether this view was restored (no such
attribute present) and a postback is happening, or whether
this view was created (no postback is happening).
public static final java.lang.String PAGE_BEANS_CREATED
Request attribute key under which a List of the
AbstractPageBeans that have been created for the current
request are stored. Typically, there will be either one or two
page beans on this list, depending on whether page navigation has
taken place or not, but will be more if/when static or dynamic
includes are used.
| Constructor Detail |
|---|
public ViewHandlerImpl(javax.faces.application.ViewHandler handler)
Construct a new ViewHandlerImpl that delegates to the
specified ViewHandler instance.
handler - The ViewHandler instance to which we will delegate| Method Detail |
|---|
public java.util.Locale calculateLocale(javax.faces.context.FacesContext context)
Return an appropriate Locale to use for this
and subsequent requests for the current client.
calculateLocale in class javax.faces.application.ViewHandlercontext - FacesContext for the current request
java.lang.NullPointerException - if context
is nullpublic java.lang.String calculateRenderKitId(javax.faces.context.FacesContext context)
Return an appropriate RenderKit identifier
for this and subsequent requests from the current
client.
calculateRenderKitId in class javax.faces.application.ViewHandlercontext - FacesContext for the current request
java.lang.NullPointerException - if context
is null
public javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext context,
java.lang.String viewId)
Create and return a new UIViewRoot instance
initialized with information from this FacesContext
for the specified viewId.
createView in class javax.faces.application.ViewHandlercontext - FacesContext for the current requestviewId - View identifier of the view to be created
java.lang.NullPointerException - if context
or viewId is null
public java.lang.String getActionURL(javax.faces.context.FacesContext context,
java.lang.String viewId)
Return a URL suitable for rendering that selects the specified view identifier.
getActionURL in class javax.faces.application.ViewHandlercontext - FacesContext for the current requestviewId - View identifier of the desired view
java.lang.NullPointerException - if context
or viewId is null
public java.lang.String getResourceURL(javax.faces.context.FacesContext context,
java.lang.String path)
Return a URL suitable for rendering that selects the specified resource.
getResourceURL in class javax.faces.application.ViewHandlercontext - FacesContext for the current requestpath - Context-relative resource path to reference
java.lang.NullPointerException - if context
or path is null
public void renderView(javax.faces.context.FacesContext context,
javax.faces.component.UIViewRoot viewRoot)
throws java.io.IOException,
javax.faces.FacesException
Perform the necessary actions to render the specified view as part of the current response.
renderView in class javax.faces.application.ViewHandlercontext - FacesContext for the current requestviewRoot - View to be rendered
java.lang.NullPointerException - if context
or viewRoot is null
java.io.IOException
javax.faces.FacesException
public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context,
java.lang.String viewId)
Perform necessary actions to restore the specified view
and return a corresponding UIViewRoot. If there
is no view information to be restored, return null.
restoreView in class javax.faces.application.ViewHandlercontext - FacesContext for the current requestviewId - View identifier of the view to be restored
java.lang.NullPointerException - if context
or viewId is null
public void writeState(javax.faces.context.FacesContext context)
throws java.io.IOException
Take appropriate action to save the current state information.
writeState in class javax.faces.application.ViewHandlercontext - FacesContext for the current request
java.io.IOException - if an input/output error occurs
java.lang.NullPointerException - if context
is nullpublic javax.faces.event.PhaseId getPhaseId()
Return PhaseId.ANY_PHASE because we are interested
in all phase events.
getPhaseId in interface javax.faces.event.PhaseListenerpublic void beforePhase(javax.faces.event.PhaseEvent event)
Process the specified before phase event.
beforePhase in interface javax.faces.event.PhaseListenerevent - PhaseEvent to be processedpublic void afterPhase(javax.faces.event.PhaseEvent event)
Process the specified after phase event.
afterPhase in interface javax.faces.event.PhaseListenerevent - PhaseEvent to be processed
public static void cache(javax.faces.context.FacesContext context,
java.lang.Exception exception)
Cache the specified exception in a request scope attribute
that application logic can use to invoke error processing.
All such cached exceptions will be available in the List
used to maintain the cache.
context - FacesContext for the current requestexception - Exception to be cached
public static void record(javax.faces.context.FacesContext context,
AbstractPageBean bean)
Record the specified AbstractPageBean on the list of
page beans that have been , and therefore need to have their
beforePhase() and afterPhase() methods called at appropriate times.
context - FacesContext for this requestbean - Page bean to be added to the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||