Top Description Fields Constructors Methods
com.sun.faces.lifecycle

public Class RestoreViewPhase

extends Phase
Class Inheritance
Static Imports
com.sun.faces.renderkit.RenderKitUtils.getResponseStateManager, com.sun.faces.util.MessageUtils.NULL_CONTEXT_ERROR_MESSAGE_ID, .MessageUtils.NULL_REQUEST_VIEW_ERROR_MESSAGE_ID, .MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID, .MessageUtils.getExceptionMessageString, .Util.getViewHandler, .Util.isOneOf, jakarta.faces.component.visit.VisitHint.SKIP_ITERATION, jakarta.faces.event.PhaseId.RESTORE_VIEW, jakarta.faces.render.ResponseStateManager.NON_POSTBACK_VIEW_TOKEN_PARAM, jakarta.faces.view.ViewMetadata.hasMetadata, java.nio.charset.StandardCharsets.UTF_8, java.util.logging.Level.FINE, .Level.SEVERE

Lifetime And Scope

Same lifetime and scope as DefaultLifecycleImpl.

Field Summary

Modifier and TypeField and Description
private static final Logger
private static final Set<VisitHint>
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
doPhase(FacesContext
the FacesContext for the current request
context
,
Lifecycle
the lifecycle for this request
lifecycle
,
ListIterator<PhaseListener> listeners)

Overrides com.sun.faces.lifecycle.Phase.doPhase.

Performs PhaseListener processing and invokes the execute method of the Phase.

public void
execute(FacesContext
FacesContext for the current request being processed
facesContext
)

Implements abstract com.sun.faces.lifecycle.Phase.execute.

POSTCONDITION: The facesContext has been initialized with a tree.

public PhaseId
private static boolean

Returns:

true if WEBAPP_ERROR_PAGE_MARKER is found in the request, otherwise return false
isErrorPage
(FacesContext
the FacesContext for the current request
context
)

The Servlet specification states that if an error occurs in the application and there is a matching error-page declaration, the that original request the cause the error is forwarded to the error page.

private boolean
isProtectedView(String viewToCheck, Set<String> urlPatterns)

private void
private void
notifyAfter(FacesContext
the FacesContext for the current request
context
,
Lifecycle
lifecycle instance
lifecycle
)

Notify afterPhase listener that is registered on the View Root.

private boolean
Inherited from com.sun.faces.lifecycle.Phase:
handleAfterPhasehandleBeforePhasequeueExceptionqueueException

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Hides com.sun.faces.lifecycle.Phase.LOGGER.

SKIP_ITERATION_HINTback to summary
private static final Set<VisitHint> SKIP_ITERATION_HINT
WEBAPP_ERROR_PAGE_MARKERback to summary
private static final String WEBAPP_ERROR_PAGE_MARKER

Constructor Detail

RestoreViewPhaseback to summary
public RestoreViewPhase()

Method Detail

deliverPostRestoreStateEventback to summary
private void deliverPostRestoreStateEvent(FacesContext facesContext) throws FacesException
doPhaseback to summary
public void doPhase(FacesContext context, Lifecycle lifecycle, ListIterator<PhaseListener> listeners)

Overrides com.sun.faces.lifecycle.Phase.doPhase.

Doc from com.sun.faces.lifecycle.Phase.doPhase.

Performs PhaseListener processing and invokes the execute method of the Phase.

Parameters
context:FacesContext

the FacesContext for the current request

lifecycle:Lifecycle

the lifecycle for this request

Annotations
@Override
executeback to summary
public void execute(FacesContext facesContext) throws FacesException

Implements abstract com.sun.faces.lifecycle.Phase.execute.

Precondition

the necessary factories have been installed in the ServletContext attr set.

POSTCONDITION: The facesContext has been initialized with a tree.

Parameters
facesContext:FacesContext

Doc from com.sun.faces.lifecycle.Phase.execute.

FacesContext for the current request being processed

Annotations
@Override
Exceptions
FacesException:

Doc from com.sun.faces.lifecycle.Phase.execute.

if a processing error occurred while executing this phase

getIdback to summary
public PhaseId getId()

Implements abstract com.sun.faces.lifecycle.Phase.getId.

Returns:PhaseId

Doc from com.sun.faces.lifecycle.Phase.getId.

the current jakarta.faces.lifecycle.Lifecycle Phase identifier.

Annotations
@Override
isErrorPageback to summary
private static boolean isErrorPage(FacesContext context)

The Servlet specification states that if an error occurs in the application and there is a matching error-page declaration, the that original request the cause the error is forwarded to the error page. If the error occurred during a post-back and a matching error-page definition was found, then an attempt to restore the error view would be made as the jakarta.faces.ViewState marker would still be in the request parameters. Use this method to determine if the current request is an error page to avoid the above condition.

Parameters
context:FacesContext

the FacesContext for the current request

Returns:boolean

true if WEBAPP_ERROR_PAGE_MARKER is found in the request, otherwise return false

isProtectedViewback to summary
private boolean isProtectedView(String viewToCheck, Set<String> urlPatterns)
maybeTakeProtectedViewActionback to summary
private void maybeTakeProtectedViewAction(FacesContext context, ViewHandler viewHandler, ViewDeclarationLanguage vdl, String viewId)
notifyAfterback to summary
private void notifyAfter(FacesContext context, Lifecycle lifecycle)

Notify afterPhase listener that is registered on the View Root.

Parameters
context:FacesContext

the FacesContext for the current request

lifecycle:Lifecycle

lifecycle instance

originatesInWebappback to summary
private boolean originatesInWebapp(FacesContext context, String view, ViewDeclarationLanguage vdl) throws URISyntaxException