javax.faces.component

Class UIViewAction

  • All Implemented Interfaces:
    EventListener, ActionSource, ActionSource2, PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder

    public class UIViewAction
    extends UIComponentBase
    implements ActionSource2

    UIViewAction represents a method invocation that occurs during the request processing lifecycle, usually in response to an initial request, as opposed to a postback.

    The ViewDeclarationLanguage implementation must cause an instance of this component to be placed in the view for each occurrence of an <f:viewAction /> element placed inside of an <f:metadata /> element. The user must place <f:metadata /> as a direct child of the UIViewRoot.

    Because this class implements ActionSource2, any actions that one would normally take on a component that implements ActionSource2, such as UICommand, are valid for instances of this class. Instances of this class participate in the regular JSF lifecycle, including on Ajax requests.

    The purpose of this component is to provide a light-weight front-controller solution for executing code upon the loading of a JSF view to support the integration of system services, content retrieval, view management, and navigation. This functionality is especially useful for non-faces (initial) requests.

    The most common use case for this component is to take actions necessary for a particular view, often with the help of one or more UIViewParameters.

    The NavigationHandler is consulted after the action is invoked to carry out the navigation case that matches the action signature and outcome. If a navigation case is matched that causes the new viewId to be different from the current viewId, the runtime must force a redirect to that matched navigation case with different viewId, regardless of whether or not the matched navigation case with different viewId called for a redirect. If the response is marked complete by the action, the lifecycle advances appropriately.

    It's important to note that the full component tree is not built before the UIViewAction components are processed on an non-faces (initial) request. Rather, the component tree only contains the ViewMetadata, an important part of the optimization of this component and what sets it apart from a PreRenderViewEvent listener.

    Since:
    2.2

Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/faces/component/uiviewaction.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com/en/java/, Class UIViewAction

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.