JSF Tutorial (11)-Lifecycle Invoke application Phase

Source: Internet
Author: User

at this stage JSF implement events that will handle any application boundary , For example, when a form is submitted or a link is clicked, it jumps to another page.

Then call the facescontext.responsecomplete method if the application needs to redirect different Web application words or generate a resource that does not shout any JSF components.

If this view is being processed from a previous request to reconstruct the state information and if a component raises an event, then these events will be passed to the relevant listener.

The final JSF implementation transfers control to the next step render Response phase

This phase is the last phase of the Execute phase of the entire JSF macro Lifecycle, followed by several stages of processing the values in turn: by processing the view according to different requests (theRestore View Phase), then take the value (Apply Request values Phase), verify the legitimacy of the values (processvalidations Phase), update the values of the components in the page ( Update Model Values Phase). The handling of the event begins when the value is finally received.

public void execute (facescontext facescontext) throws Facesexception {        if (logger.isloggable (Level.fine)) {            Logger.fine ("Entering invokeapplicationsphase");        }        Uiviewroot root = Facescontext.getviewroot ();        ASSERT (null! = root);        try {            root.processapplication (facescontext);        } catch (RuntimeException re) {            String exceptionmessage = Re.getmessage ();            if (null! = Exceptionmessage) {                if (logger.isloggable (level.warning)) {                    LOGGER.log (level.warning, Exceptionmessage, re);                }            }            throw new Facesexception (Exceptionmessage, re);        }        if (logger.isloggable (Level.fine)) {            logger.fine ("Exiting invokeapplicationsphase");        }    }

If the processapplication method is interested in children's shoes can be anti-compilation look at the source code. In fact, the description of this method is very clear in the Java EE documentation.

Broadcastany events that has been queued for the Invoke application phase of therequest processing lifecycle and to C Lear out all events for later phases Ifthe event processing for this phase caused facescontext.renderresponse () Orfacescon Text.responsecomplete () to be called.  

The general meaning is to pass events to this stage, and to clear the events that caused the above two methods to be called. Because these two methods are called to mark the end of the entire request, the current phase has not yet fully processed the request.

At this end of the entire JSF lifecycle macro the Execute section (the part executed on the server) has been executed, followed by rendering the client's page.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.