Open In App

JSF Lifecycle – Execute and Render Stage

JavaServer Faces application system oversees lifecycle stages consequently for straightforward applications and furthermore permits you to deal with that physically. The lifecycle of a JavaServer Faces application starts when the customer makes an HTTP demand for a page and closures when the worker reacts with the page.  

The JSF lifecycle is partitioned into two fundamental stages:  



  1. Execute Stage
  2. Render Stage

1) Execute Stage  

In execute stage, when the first solicitation is made, the application sees is fabricated or reestablished. For other resulting demands different activities are performed like solicitation boundary esteems are applied, transformations and approvals are performed for part esteems, overseen beans are refreshed with segment esteems and application rationale is conjured.  

The execute stage is additionally partitioned into following subphases.  



Restore View Stage :

At the point when a customer demands a JavaServer Faces page, the JavaServer Faces usage starts the reestablish see stage. In this stage, JSF fabricates the perspective on the mentioned page, wires occasion overseers and validators to segments in the view, and saves the view in the FacesContext example.  

In the event that the solicitation for the page is a postback, a view relating to this page as of now exists in the FacesContext example. During this stage, the JavaServer Faces execution reestablishes the view by utilizing the state data saved money on the customer or the worker.  

Apply request values Stage :

In this stage, the segment tree is reestablished during a postback demand. A segment tree is an assortment of structure elements. Each segment in the tree removes its new incentive from the solicitation boundaries by utilizing its disentangle (processDecodes()) strategy. After that worth is put away locally on every segment.  

On the off chance that any decipher techniques or occasion audience members have called the renderResponse strategy on the current FacesContext example, the JavaServer Faces usage jumps to the Render Reaction stage.  

On the off chance that any occasions have been lined during this stage, the JavaServer Faces usage communicates the occasions to intrigued audience members.  

In the event that the application needs to divert to an alternate web application asset or create a reaction that doesn’t contain any JavaServer Faces segments, it can call the FacesContext.responseComplete() strategy.  

In the event that the current solicitation is recognized as a halfway solicitation, the incomplete setting is recovered from the FacesContext, and the fractional handling technique is applied.  

Process Approvals Stage :

In this stage, the JavaServer Faces measures all validators enrolled on the segments by utilizing its approve () strategy. It looks at the segment ascribes that indicate the guidelines for the approval and thinks about these standards to the nearby worth put away for the segment. The JavaServer Faces additionally finishes changes for input segments that don’t have the prompt trait set to valid.  

if that any approved strategies or occasion audience members have called the renderResponse technique on the current FacesContext, the JavaServer Faces execution jumps to the Render Reaction stage.

if that the application needs to divert to an alternate web application asset or produce a reaction that doesn’t contain any JavaServer Faces segments, it can call the FacesContext.responseComplete strategy.  

if those occasions have been lined during this stage, the JavaServer Faces execution communicates them to intrigued audience members.  

In the event that the current solicitation is distinguished as a fractional solicitation, the halfway setting is recovered from the FacesContext, and the incomplete handling strategy is applied.  

Update Model Qualities Stage : 

Subsequent to guaranteeing that the information is legitimate, it navigates the part tree and sets the comparing worker side article properties to the segments’ neighborhood esteems. The JavaServer Faces usage refreshes just the bean properties pointed at by an information part’s worth trait. On the off chance that the nearby information can’t be changed over to the sorts indicated by the bean properties, the lifecycle propels straightforwardly to the Render Reaction stage so the page is re-delivered with blunders shown.

if the chance that any updateModels techniques or any audience members have called the renderResponse() strategy on the current FacesContext occurrence, the JavaServer Faces usage jumps to the Render Reaction stage.  

In the event that the application needs to divert to an alternate web application asset or create a reaction that doesn’t contain any JavaServer Faces segments, it can call the FacesContext.responseComplete() technique.  

if that any occasions have been lined during this stage, the JavaServer Faces execution communicates them to intrigued audience members.  

If the current solicitation is distinguished as a fractional solicitation, the incomplete setting is recovered from the FacesContext, and the halfway handling technique is applied.  

Invoke Application Stage :

In this stage, JSF handles application-level occasions, for example, presenting a structure or connecting to another page.  

Presently, if the application needs to divert to an alternate web application asset or produce a reaction that doesn’t contain any JSF segments, it can call the FacesContext.responseComplete() technique.  

From that point forward, the JavaServer Faces execution moves control to the Render Reaction stage.  

Render Reaction Stage:  

2) Render :

In this stage, the mentioned see is delivered as a reaction to the customer program. View delivering is a cycle in which output is produced as HTML or XHTML. In this way, the client can see it in the program.  

Article Tags :